Skip to content

Commit

Permalink
Fix Magento\Sales\Service\V1\ShipmentGetTest::testShipmentGet
Browse files Browse the repository at this point in the history
  • Loading branch information
slackerzz committed Jun 10, 2018
1 parent 33393e2 commit 9e5757d
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/
namespace Magento\Sales\Service\V1;

use Magento\Framework\Api\ExtensibleDataInterface;
use Magento\Framework\Api\SimpleDataObjectConverter;
use Magento\TestFramework\TestCase\WebapiAbstract;

/**
Expand Down Expand Up @@ -57,7 +59,18 @@ public function testShipmentGet()
unset($data['tracks']);
foreach ($data as $key => $value) {
if (!empty($value)) {
$this->assertEquals($shipment->getData($key), $value, $key);
if ($key === ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY) {
foreach ($value as $extensionAttributeKey => $extensionAttributeValue) {
$methodName = 'get' .
SimpleDataObjectConverter::snakeCaseToUpperCamelCase($extensionAttributeKey);
$this->assertEquals(
$shipment->getExtensionAttributes()->$methodName(),
$extensionAttributeValue
);
}
} else {
$this->assertEquals($shipment->getData($key), $value, $key);
}
}
}
$shipmentItem = $this->objectManager->get(\Magento\Sales\Model\Order\Shipment\Item::class);
Expand Down

0 comments on commit 9e5757d

Please sign in to comment.