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

PhpUnit 8 Migration - Framework & AdminAnalytics #27519

Merged

Conversation

ihor-sviziev
Copy link
Contributor

@ihor-sviziev ihor-sviziev commented Mar 31, 2020

Description (*)

This PR doing following:

  1. Fix library related to unit tests, now it works both with phpunit 6 and phpunit 8
  2. Fix signature in unit tests inside class
  3. Add to obsolete classes list PHPUnit_Framework_MockObject_MockObject and PHPUnit\Framework\BaseTestListener

Related Pull Requests

Fixed Issues (if relevant)

  1. Unit Tests incompatible with PHPUnit 8 #27500

Manual testing scenarios (*)

  1. Run tests in phpunit 6 (currently in 2.4-develop) using vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist app/code/Magento/AdminAnalytics/
  2. Install phpunit 8, run tests using vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist app/code/Magento/AdminAnalytics/

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)

Fix fatal error because signature has changed
Add to obsolete classes PhpUnit 6.x only classes
@m2-assistant
Copy link

m2-assistant bot commented Mar 31, 2020

Hi @ihor-sviziev. 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.

Fix static tests
@lbajsarowicz lbajsarowicz self-assigned this Mar 31, 2020
@lenaorobei
Copy link
Contributor

@magento run Static Tests

@lenaorobei
Copy link
Contributor

Static error from logs:

Stacktrace
Magento\Test\Legacy\ObsoleteCodeTest
PHPUnit\Framework\Exception: Notice: Undefined offset: 1 in /var/www/html/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteCodeTest.php:105.

/var/www/html/dev/tests/static/framework/bootstrap.php:62
/var/www/html/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteCodeTest.php:105
/var/www/html/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteCodeTest.php:82
/var/www/html/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteCodeTest.php:48

@ihor-sviziev
Copy link
Contributor Author

@lenaorobei will check it, thx

@ihor-sviziev
Copy link
Contributor Author

@lbajsarowicz static test failure fixed, please review again

Copy link
Contributor

@lbajsarowicz lbajsarowicz left a comment

Choose a reason for hiding this comment

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

Great job, thank you!

@magento-engcom-team
Copy link
Contributor

Hi @lbajsarowicz, thank you for the review.
ENGCOM-7270 has been created to process this Pull Request
✳️ @lbajsarowicz, 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

@lenaorobei lenaorobei added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Apr 5, 2020
@m2-assistant
Copy link

m2-assistant bot commented Apr 9, 2020

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

6 participants