-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Magento\Sales\Service\V1\ShipmentGetTest::testShipmentGet #1350
Conversation
fbfbede
to
6821323
Compare
@@ -57,7 +58,14 @@ public function testShipmentGet() | |||
unset($data['tracks']); | |||
foreach ($data as $key => $value) { | |||
if (!empty($value)) { | |||
$this->assertEquals($shipment->getData($key), $value, $key); | |||
if($key === 'extension_attributes') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should have space between if
and (
@@ -57,7 +58,14 @@ public function testShipmentGet() | |||
unset($data['tracks']); | |||
foreach ($data as $key => $value) { | |||
if (!empty($value)) { | |||
$this->assertEquals($shipment->getData($key), $value, $key); | |||
if($key === 'extension_attributes') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should use constant ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY
@@ -57,7 +58,14 @@ public function testShipmentGet() | |||
unset($data['tracks']); | |||
foreach ($data as $key => $value) { | |||
if (!empty($value)) { | |||
$this->assertEquals($shipment->getData($key), $value, $key); | |||
if($key === 'extension_attributes') { | |||
foreach ($value as $k => $val) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use more precise variable names instead of $k
and $val
shortening is always bad practice
$this->assertEquals($shipment->getExtensionAttributes()->$methodName(), $val); | ||
} | ||
} else { | ||
$this->assertEquals($shipment->getData($key), $value, $key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same Pull Request should be created for https://github.com/magento/magento2 github
also, please provide cross-linkage between them
6821323
to
4ae69b3
Compare
@maghamed I've updated the pull request according your suggestions. Let me know if it's ok now and I'll create it in magento/magento2 |
4ae69b3
to
b40a94e
Compare
Description
Fixed Issues (if relevant)
Related magento pull request: Fix Magento\Sales\Service\V1\ShipmentGetTest::testShipmentGet magento2#15982
Manual testing scenarios
Contribution checklist