Skip to content
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

Merged
merged 1 commit into from
Jun 14, 2018

Conversation

slackerzz
Copy link
Member

@slackerzz slackerzz commented Jun 10, 2018

Description

Fixed Issues (if relevant)

  1. Fix Magento\Sales\Service\V1\ShipmentGetTest::testShipmentGet #1336: Issue title
    Related magento pull request: Fix Magento\Sales\Service\V1\ShipmentGetTest::testShipmentGet magento2#15982

Manual testing scenarios

  1. ...
  2. ...

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@@ -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') {
Copy link
Contributor

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') {
Copy link
Contributor

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) {
Copy link
Contributor

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);
Copy link
Contributor

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

@slackerzz
Copy link
Member Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants