-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Unit Tests incompatible with PHPUnit 8 #27500
Comments
Hi @lbajsarowicz. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. @lbajsarowicz do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
Hi @lbajsarowicz, I'll take care of |
I'm going to take care of |
Hi @lbajsarowicz, I would like to care about |
Hi @lbajsarowicz, I would like to take care app/code/Magento/Payment |
Hey @lbajsarowicz, |
Hi @lbajsarowicz. Thank you for your report. The fix will be available with the upcoming release. |
Hi @lbajsarowicz. Thank you for your report.
The fix will be available with the upcoming release. |
Hi @lbajsarowicz. Thank you for your report. The fix will be available with the upcoming release. |
Hi @lbajsarowicz. Thank you for your report. The fix will be available with the upcoming release. |
Hi @lbajsarowicz. Thank you for your report. The fix will be available with the upcoming release. |
Hi @lbajsarowicz. Thank you for your report. The fix will be available with the upcoming release. |
Hi @lbajsarowicz. Thank you for your report.
The fix will be available with the upcoming release. |
Hi @lbajsarowicz. Thank you for your report.
The fix will be available with the upcoming release. |
Hi @lbajsarowicz. Thank you for your report. The fix will be available with the upcoming release. |
Hi @lbajsarowicz. Thank you for your report. The fix will be available with the upcoming release. |
Hi @lbajsarowicz. Thank you for your report.
The fix will be available with the upcoming release. |
Hi @lbajsarowicz. Thank you for your report.
The fix will be available with the upcoming release. |
Hi @lbajsarowicz. Thank you for your report. The fix will be available with the upcoming release. |
Hi @lbajsarowicz. Thank you for your report. The fix will be available with the upcoming release. |
Hi @lbajsarowicz. Thank you for your report.
The fix will be available with the upcoming release. |
Hi @lbajsarowicz. Thank you for your report.
The fix will be available with the upcoming release. |
Hi @lbajsarowicz. Thank you for your report. The fix will be available with the upcoming release. |
Need to |
@zhartaunik do you have this issue on 2.4-develop branch? |
Yes |
@zhartaunik could you report separate issue for that? Thank you! |
Hi @ihor-sviziev |
Hi @lbajsarowicz. Thank you for your report.
The fix will be available with the upcoming 2.4.2 release. |
Magento is slowly moving towards the latest dependencies in the PHP world. Part of this is to have (at least) supported version of PHPUnit ( https://phpunit.de/supported-versions.html )
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
Contribution
What needs to be done
Most of the cases, the scenario to make Unit Tests compatible with PHPUnit 8 is:
setUp
andtearDown
methods has to have: void
return type hintPHPUnit_Framework_TestCase
withPHPUnit\Framework\TestCase
\PHPUnit_Framework_MockObject_MockObject
with\PHPUnit\Framework\MockObject\MockObject
@expectedException \Magento\Framework\Exception\ConfigurationMismatchException
annotation with$this->expectException(\Magento\Framework\Exception\ConfigurationMismatchException::class)
@expectedExceptionMessage
with$this->expectExceptionMessage('The message');
If you find any other typical steps to be done - let me know in the comment, I'm going to update the issue.
PHPUnit 9+ compatibility
https://phpunit.de/announcements/phpunit-8.html
Review the use of deprecated methods:
assertContains
,assertNotContains
etc.... and annotations
expectException
,expectExceptionMessage
etc.Notice!
Make sure that you have linted your code after finish your work!
❗ ❗ ❗ If you see Tests that test nothing - rewrite or remove them. Let's avoid massive delusion of Tests coverage, based on the tests that test implementation instead of method / unit outcome!
Modules
Due to some compatibility issues and to make Code Review easier - please do your changes per module. You can find list of checkboxes underneath with list of modules that should be covered. When you start working on specific module, please check the chekbox and add the comment which module you start work. When you finish - edit your commend adding the link to PR.
Open Source
B2B
EE
Inventory module
The text was updated successfully, but these errors were encountered: