Skip to content

Conversation

edenduong
Copy link
Contributor

Description (*)

Cover the Observer SetHasDownloadableProductsObserver by Unit Test

Session has downloadable products

Session has no downloadable product

  • Order has once item is downloadable product
  • Order has all items are simple product

Fixed Issues (if relevant)

  1. magento/magento2#<issue_number>: Issue title

Manual testing scenarios (*)

vendor/bin/phpunit app/code/Magento/Downloadable/Test/Unit/Observer/SetHasDownloadableProductsObserverTest.php

Questions or comments

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 are green)

@m2-assistant
Copy link

m2-assistant bot commented Dec 16, 2019

Hi @edenduong. 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 give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@kalpmehta kalpmehta self-assigned this Dec 16, 2019
@magento-engcom-team
Copy link
Contributor

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

@engcom-Charlie
Copy link
Contributor

✔️ QA Passed

Comment on lines +121 to +122
$productType = DownloadableProductType::TYPE_DOWNLOADABLE,
$realProductType = DownloadableProductType::TYPE_DOWNLOADABLE,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that you always test with the same value for productType and realProductType`.
In that specific case, it's against YAGNI :-)

Removing the redundant argument, you'll also get side effect of cleaner DataProvider method (oneliners)

magento-engcom-team pushed a commit that referenced this pull request Dec 19, 2019
@magento-engcom-team magento-engcom-team merged commit 4002829 into magento:2.4-develop Dec 19, 2019
@m2-assistant
Copy link

m2-assistant bot commented Dec 19, 2019

Hi @edenduong, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

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.

7 participants