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

Magento_Sales integration tests: Fix addresses in order_list fixture #16351

Merged
merged 5 commits into from
Sep 26, 2018
Merged

Magento_Sales integration tests: Fix addresses in order_list fixture #16351

merged 5 commits into from
Sep 26, 2018

Conversation

evktalo
Copy link
Contributor

@evktalo evktalo commented Jun 22, 2018

Description

Addresses are broken in the order_list.php integration test fixture.

Instead of setting billing address twice, set both billing address and shipping address.
Reset $billingAddress and $shippingAddress variables with newly created Address objects. Otherwise trying to access the order's address data gives an error. (e.g. 'Call to a member function on null' when trying to use $order->getBillingAddress()->getFirstname())

Additionally, improve code style slightly.

I don't think this affects the present integration tests that use this fixture, but when you try to use this fixture in a test that does use the addresses, it will not work.

Fixed Issues (if relevant)

None.

Manual testing scenarios

  1. Create an integration test that uses order_list fixture
  2. Create order in the test
  3. Call $order->getShipppingAddress()->getFirstname()

Without the fix, you will get a 'Call to a member function on null' error.

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)

@magento-engcom-team
Copy link
Contributor

Hi @evktalo. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me {$VERSION} instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@evktalo evktalo changed the title Magento_Sales integration tests: Fix order list set billing address twice Magento_Sales integration tests: Fix addresses in order_list fixture Jun 23, 2018
@magento-engcom-team magento-engcom-team added this to the Release: 2.3.0 milestone Jul 10, 2018
… module tests

 - Use the order repository for saving,
 - Use guest customer,
 - Attach email address to order,
@magento-engcom-team
Copy link
Contributor

Hi @dmanners, thank you for the review.
ENGCOM-2252 has been created to process this Pull Request

@magento-engcom-team
Copy link
Contributor

Hi @evktalo. Thank you for your contribution.
We will aim to release these changes as part of 2.3.1.
Please check the release notes for final confirmation.

@evktalo evktalo deleted the fix-order_list-set-billing-address-twice branch March 12, 2019 10:29
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.

3 participants