-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add empty package when storing namespaced object in vehicle (#201)
Objects stored in an xPDOVehicle from classes with a namespace should not add a package containing that namespace to the vehicle payload. Doing so causes unnecessary attempts to load classes with the namespace prefixed to the already fully-qualified classname.
- Loading branch information
Showing
7 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
/* | ||
* The file is part of the xPDO package. | ||
* | ||
* Copyright (c) Jason Coward <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace xPDO\Test\Transport; | ||
|
||
|
||
use xPDO\Test\Sample\xPDOSample; | ||
use xPDO\TestCase; | ||
use xPDO\Transport\xPDOObjectVehicle; | ||
use xPDO\Transport\xPDOTransport; | ||
|
||
class xPDOVehicleTest extends TestCase | ||
{ | ||
public function testPutDoesNotAddPackageForNamespacedClass() | ||
{ | ||
$transport = new xPDOTransport($this->xpdo, uniqid('transport-'), self::$properties['xpdo_test_path'] . 'fs/transport/'); | ||
|
||
$object = $this->xpdo->newObject(xPDOSample::class); | ||
|
||
$vehicle = new xPDOObjectVehicle(); | ||
$vehicle->put($transport, $object); | ||
|
||
$this->assertEmpty($vehicle->payload['package']); | ||
} | ||
} |