Skip to content

Commit

Permalink
Merge pull request magento#1350 from magespecialist/fix_issue_1336
Browse files Browse the repository at this point in the history
Fix Magento\Sales\Service\V1\ShipmentGetTest::testShipmentGet
  • Loading branch information
Valeriy Nayda authored Jun 14, 2018
2 parents ad42040 + b40a94e commit d30171b
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 d30171b

Please sign in to comment.