Skip to content

[Unit] Fix broken unit tests #23592

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

Merged

Conversation

Den4ik
Copy link
Contributor

@Den4ik Den4ik commented Jul 5, 2019

Description (*)

This PR fixing broken unit tests:

  1. PHP Fatal error: Class Mock_OrderPaymentExtensionInterface_175badce contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Magento\Sales\Api\Data\OrderPaymentExtensionInterface::getVaultPaymentToken) in 23dev/vendor/phpunit/phpunit-mock-objects/src/Generator.php(264) : eval()'d code on line 1
  2. Magento\TestFramework\Dependency\PhpRuleTest::testGetDependencyInfoCaseGetUrl with data set "getUrl from same module" ('Magento\Cms\SomeClass', '$this->getUrl("cms/index/index")', array()) Magento\Framework\Exception\LocalizedException: Invalid URL path: cms/index/index
  3. Magento\TestFramework\Dependency\PhpRuleTest::testGetDependencyInfoCaseGetUrl with data set "getUrl from another module" ('Magento\SomeModule\SomeClass', '$this->getUrl("cms/index/index")', array(array('Magento\Cms', 'hard', 'getUrl("cms/index/index"'))) Magento\Framework\Exception\LocalizedException: Invalid URL path: cms/index/index
  4. Magento\Reports\Test\Unit\Model\ResourceModel\Product\CollectionTest::testAddViewsCount Error: Call to a member function getDefaultAttributeSetId() on null

Fixed Issues (if relevant)

No issue

Manual testing scenarios (*)

  1. run php bin/magento dev:tests:run unit

Questions or comments

Another one failed test:
Magento\Framework\App\Test\Unit\ObjectManagerFactoryTest::testCreateObjectManagerFactoryCouldBeOverridden Failed asserting that exception of type "\BadMethodCallException" is thrown.

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 Jul 5, 2019

Hi @Den4ik. 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.3-develop instance - deploy vanilla Magento instance

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

@orlangur
Copy link
Contributor

Hi @Den4ik, another failed test was already reported in #11268

@Den4ik
Copy link
Contributor Author

Den4ik commented Jul 10, 2019

Hi @orlangur
Thanks for the reference

@Den4ik Den4ik force-pushed the bug/fix-broken-unit-tests branch from df8f027 to 8194cf9 Compare July 12, 2019 18:49
Copy link
Contributor

@orlangur orlangur left a comment

Choose a reason for hiding this comment

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

Thanks @Den4ik! Didn't check locally but from 9 checks this seems to be ready.

@engcom-Alfa engcom-Alfa self-assigned this Jul 15, 2019
@magento-engcom-team
Copy link
Contributor

Hi @orlangur, thank you for the review.
ENGCOM-5438 has been created to process this Pull Request
✳️ @orlangur, 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 Jul 15, 2019
@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

@m2-assistant
Copy link

m2-assistant bot commented Jul 18, 2019

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

@magento-engcom-team magento-engcom-team added this to the Release: 2.3.3 milestone Jul 18, 2019
@Den4ik Den4ik deleted the bug/fix-broken-unit-tests branch July 19, 2019 10:41
@VladimirZaets VladimirZaets added the Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests label Sep 10, 2019
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.

6 participants