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

Sitemap Observer Unit Test improvement: Expect email notification to send, and simplify setup a bit. #27448

Conversation

evktalo
Copy link
Contributor

@evktalo evktalo commented Mar 26, 2020

Description (*)

Add an expect for the emailNotification's sendErrors method. This makes the test match its title (testScheduledGenerateSitemapsSendsExceptionEmail) better.

Also try to be more consistent when calling PHPUnit's TestCase's mock creation functions in setUp; favour createMock.

Related Pull Requests

Fixed Issues (if relevant)

Manual testing scenarios (*)

  1. install magento
  2. in root, call vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist app/code/Magento/Sitemap/Test/Unit/Model/ObserverTest.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 Mar 26, 2020

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 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.

@ghost ghost added this to Pending Review in Pull Requests Dashboard Mar 26, 2020
@magento-engcom-team magento-engcom-team added Component: Sitemap Release Line: 2.4 Partner: Vaimo Pull Request is created by partner Vaimo partners-contribution Pull Request is created by Magento Partner labels Mar 26, 2020
@evktalo evktalo changed the title Expect email notification to send, and simplify setup a bit. Sitemap Observer Unit Test improvement: Expect email notification to send, and simplify setup a bit. Mar 26, 2020
@edenduong edenduong self-assigned this Mar 26, 2020
Copy link
Contributor

@edenduong edenduong left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution!

@ghost ghost moved this from Pending Review to Ready for Testing in Pull Requests Dashboard Mar 26, 2020
@magento-engcom-team
Copy link
Contributor

Hi @edenduong, thank you for the review.
ENGCOM-7209 has been created to process this Pull Request
✳️ @edenduong, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@engcom-Alfa engcom-Alfa self-assigned this Mar 26, 2020
@engcom-Alfa engcom-Alfa moved this from Ready for Testing to Testing in Progress in Pull Requests Dashboard Mar 26, 2020
@engcom-Alfa engcom-Alfa added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Mar 26, 2020
@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

@engcom-Alfa engcom-Alfa moved this from Testing in Progress to Extended Testing (optional) in Pull Requests Dashboard Mar 26, 2020
@engcom-Kilo engcom-Kilo self-assigned this Mar 26, 2020
@engcom-Echo
Copy link
Contributor

@magento run Functional Tests B2B, Functional Tests CE

@engcom-Kilo engcom-Kilo moved this from Extended Testing (optional) to Merge in Progress in Pull Requests Dashboard Apr 13, 2020
@ghost ghost added the Progress: accept label Apr 13, 2020
@VladimirZaets VladimirZaets added this to the 2.4.0 milestone Apr 13, 2020
Fixed PHPUnit_Framework_MockObject_MockObject usages
magento-engcom-team pushed a commit that referenced this pull request Apr 14, 2020
@magento-engcom-team magento-engcom-team merged commit 2bb6ed3 into magento:2.4-develop Apr 14, 2020
@m2-assistant
Copy link

m2-assistant bot commented Apr 14, 2020

Hi @evktalo, 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.

@ghost ghost moved this from Merge in Progress to Recently Merged in Pull Requests Dashboard Apr 14, 2020
@magento-engcom-team magento-engcom-team removed this from Recently Merged in Pull Requests Dashboard Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Component: Sitemap Partner: Vaimo Pull Request is created by partner Vaimo partners-contribution Pull Request is created by Magento Partner Progress: accept Release Line: 2.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants