Magento2: Magento has many errors in the framework of the tests

Created on 5 Jul 2016  路  18Comments  路  Source: magento/magento2

Output dev:tests:run

I run dev:tests:run and final log is:

FAILURES!
Tests: 367, Assertions: 23858, Failures: 3, Errors: 2, Incomplete: 1, Skipped: 238.

Some lines of debug:

...........PHP Notice: Object of class Magento\Framework\Phrase could not be converted to int in /home/vagrant/projects/web/magento/mymagento/vendor/phpunit/phpunit/src/Framework/Constraint/StringContains.php on line 99 . Notice: Object of class Magento\Framework\Phrase could not be converted to int in /home/vagrant/projects/web/magento/mymagento/vendor/phpunit/phpunit/src/Framework/Constraint/StringContains.php on line 99 PHP Notice: Object of class Magento\Framework\Phrase could not be converted to int in /home/vagrant/projects/web/magento/mymagento/vendor/phpunit/phpunit/src/Framework/Constraint/StringContains.php on line 99 . Notice: Object of class Magento\Framework\Phrase could not be converted to int in /home/vagrant/projects/web/magento/mymagento/vendor/phpunit/phpunit/src/Framework/Constraint/StringContains.php on line 99 PHP Notice: Object of class Magento\Framework\Phrase could not be converted to int in /home/vagrant/projects/web/magento/mymagento/vendor/phpunit/phpunit/src/Framework/Constraint/StringContains.php on line 99 . Notice: Object of class Magento\Framework\Phrase could not be converted to int in /home/vagrant/projects/web/magento/mymagento/vendor/phpunit/phpunit/src/Framework/Constraint/StringContains.php on line 99 PHP Notice: Object of class Magento\Framework\Phrase could not be converted to int in /home/vagrant/projects/web/magento/mymagento/vendor/phpunit/phpunit/src/Framework/Constraint/StringContains.php on line 99 . Notice: Object of class Magento\Framework\Phrase could not be converted to int in /home/vagrant/projects/web/magento/mymagento/vendor/phpunit/phpunit/src/Framework/Constraint/StringContains.php on line 99 PHP Notice: Object of class Magento\Framework\Phrase could not be converted to int in /home/vagrant/projects/web/magento/mymagento/vendor/phpunit/phpunit/src/Framework/Constraint/StringContains.php on line 99 . Notice: Object of class Magento\Framework\Phrase could not be converted to int in /home/vagrant/projects/web/magento/mymagento/vendor/phpunit/phpunit/src/Framework/Constraint/StringContains.php on line 99 PHP Notice: Object of class Magento\Framework\Phrase could not be converted to int in /home/vagrant/projects/web/magento/mymagento/vendor/phpunit/phpunit/src/Framework/Constraint/StringContains.php on line 99

And also I don't know how the dev tests unable to access the database.

kharkivcd19 Confirmed Format is not valid Ready for Work Reproduced on 2.2.x Reproduced on 2.3.x bug report

Most helpful comment

@francisrod01, thank you for your report.
The issue has been fixed in magento/magento2#2092 by @orlangur in 2.3-develop branch
Related commit(s):

  • fff51bcb00aa7daf99e703570db2ba193c7e427f

All 18 comments

Please specify Magento affected version.
Also provide info about your environment (php, mysql, web-server and so on)

@odubovyk my settings is:

  • PHP 7.1.0beta2
  • Apache/2.4.18 (Ubuntu)
  • mysql-server 5.7

Regarding setting up the integration tests database, maybe this page will be helpful: http://devdocs.magento.com/guides/v2.1/test/integration/integration_test_execution.html

@devtosystems please specify Magento version. If the problem is actual for a specific tag, please, specify it and be sure that the latest update was used.

@veloraven more about magento version in composer file

{ "name": "magento/project-community-edition",
    "description": "eCommerce Platform for Growth (Community Edition)",
    "type": "project",
    "version": "2.1.0",

Same here after running unit tests: magento dev:tests:run unit
I'm getting the same notice.

  • Magento DevBox
  • Version 2.1.5
  • With sample data
    It was done on a fresh magento install.
Notice: Object of class Magento\Framework\Phrase could not be converted to int in /var/www/magento2/vendor/phpunit/phpunit/src/Framework/Constraint/StringContains.php on line 99

Call Stack:
    0.0001     361272   1. {main}() /var/www/magento2/vendor/phpunit/phpunit/phpunit:0
    0.0077    1006160   2. PHPUnit_TextUI_Command::main() /var/www/magento2/vendor/phpunit/phpunit/phpunit:55
    0.0077    1006256   3. PHPUnit_TextUI_Command->run() /var/www/magento2/vendor/phpunit/phpunit/src/TextUI/Command.php:132
   13.0176  237983504   4. PHPUnit_TextUI_TestRunner->doRun() /var/www/magento2/vendor/phpunit/phpunit/src/TextUI/Command.php:179
   13.0243  238269576   5. PHPUnit_Framework_TestSuite->run() /var/www/magento2/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:426
   55.5428  494175864   6. PHPUnit_Framework_TestSuite->run() /var/www/magento2/vendor/phpunit/phpunit/src/Framework/TestSuite.php:675
   55.5915  494945688   7. PHPUnit_Framework_TestSuite->run() /var/www/magento2/vendor/phpunit/phpunit/src/Framework/TestSuite.php:675
   55.5916  494946256   8. PHPUnit_Framework_TestCase->run() /var/www/magento2/vendor/phpunit/phpunit/src/Framework/TestSuite.php:675
   55.5916  494946256   9. PHPUnit_Framework_TestResult->run() /var/www/magento2/vendor/phpunit/phpunit/src/Framework/TestCase.php:753
   55.5916  494946256  10. PHPUnit_Framework_TestCase->runBare() /var/www/magento2/vendor/phpunit/phpunit/src/Framework/TestResult.php:686
   55.5998  495300528  11. PHPUnit_Framework_TestCase->runTest() /var/www/magento2/vendor/phpunit/phpunit/src/Framework/TestCase.php:817
   55.5998  495301144  12. ReflectionMethod->invokeArgs() /var/www/magento2/vendor/phpunit/phpunit/src/Framework/TestCase.php:950
   55.5998  495301224  13. Magento\Customer\Test\Unit\Controller\Account\ConfirmTest->testSuccessMessage() /var/www/magento2/vendor/phpunit/phpunit/src/Framework/TestCase.php:950
   55.6000  495315088  14. Magento\Customer\Controller\Account\Confirm->execute() /var/www/magento2/vendor/magento/module-customer/Test/Unit/Controller/Account/ConfirmTest.php:310
   55.6013  495366248  15. Mock_Manager_a6483469->addSuccess() /var/www/magento2/vendor/magento/module-customer/Controller/Account/Confirm.php:108
   55.6014  495366736  16. PHPUnit_Framework_MockObject_InvocationMocker->invoke() /var/www/magento2/vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/Generator.php(290) : eval()'d code:180
   55.6014  495368952  17. PHPUnit_Framework_MockObject_Matcher->invoked() /var/www/magento2/vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/InvocationMocker.php:113
   55.6014  495369328  18. PHPUnit_Framework_MockObject_Matcher_Parameters->matches() /var/www/magento2/vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher.php:133
   55.6014  495369328  19. PHPUnit_Framework_MockObject_Matcher_Parameters->verify() /var/www/magento2/vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/Parameters.php:74
   55.6014  495370024  20. PHPUnit_Framework_Constraint->evaluate() /var/www/magento2/vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/Parameters.php:120
   55.6014  495370024  21. PHPUnit_Framework_Constraint_StringContains->matches() /var/www/magento2/vendor/phpunit/phpunit/src/Framework/Constraint.php:90
   55.6014  495370024  22. stripos() /var/www/magento2/vendor/phpunit/phpunit/src/Framework/Constraint/StringContains.php:99

I am running into the same error.

Magento EE v 2.1.7
PHP 7.0.12

Is this issue being looking into by the Magento team?

Same issue here, when will this be fixed?

I got the same error here. I can't run the test all the unit test.
What I can do is only running the test on the installed module in the app/code folder location.

and I don't think magento team is going to solve this problem quickly ?

It this still reproducible on Magento 2.2.0 branch? Was it reproduced on any Composer-based installation of Magento or there are some additional steps?

Unit Tests:
There is 1 error and 2 failures. Additionally there are 2 PHP warnings.
This is pretty good and looks like it is fixable without too much effort.

Integration Tests:
The tests are still running (at 8% now) and there are already 8 failures...

I think this issue still is relevant.
This is on a fresh 2.2.0 composer based installation.

Thanks for checking! Wondering how it can pass through the CI loop...

@francisrod01, thank you for your report.
We've created internal ticket(s) MAGETWO-84283 to track progress on the issue.

You're welcome @magento-engcom-team !! :)
I'm tracking the updates of this issue.

kharkivcd19

Hi @orlangur. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • [ ] 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
  • [ ] 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • [ ] 4. If the issue is not relevant or is not reproducible any more, feel free to close it.

@ishakhsuvarov @sidolov to avoid such kind of issues in the future, simply make testing Composer-based installation of Magento a mandatory step of release process.

If it does not really work well for some test types, like functional, or require too much efforts, those can fall to markTestSkipped detecting the incompatible environment via test listener or something.

@francisrod01, thank you for your report.
The issue has been fixed in magento/magento2#2092 by @orlangur in 2.3-develop branch
Related commit(s):

  • fff51bcb00aa7daf99e703570db2ba193c7e427f
Was this page helpful?
0 / 5 - 0 ratings