magento-xtest icon indicating copy to clipboard operation
magento-xtest copied to clipboard

Current phpunit - version does not run on php 7.1 (simple patch provided)

Open tobihille opened this issue 8 years ago • 1 comments

Hi, after upgrading from php7.0 to 7.1 we noticed that our tests are failing. The message is :

PHP Fatal error: Uncaught Error: Using $this when not in object context in /var/www/html/magento1/.modman/magento-xtest/app/code/community/Codex/Xtest/Xtest.php:113

We figured the reason is an old phpunit version and upgraded to the latest stable (6.2.2). Sadly here the tests are failing with the following message:

PHP Fatal error: Class 'PHPUnit_Framework_TestCase' not found in /var/www/html/magento1/.modman/magento-xtest/app/code/community/Codex/Xtest/Xtest/Unit/Abstract.php on line 3

I attached a patch php7.1.patch.zip which should resolve most of the problems - at least now my tests are running again. Scince I don't use selenium tests I can not test this and left those classes as they are, I assume they are still broken when using a newer phpunit version.

I hope this helps =)

  • Tobi

tobihille avatar Jun 23 '17 08:06 tobihille

Seems like the original error is not fixed with the update of phpunit :-( I'll leave the patch despite this here scince at least we can now use the newest phpunit version;-)

tobihille avatar Jun 23 '17 09:06 tobihille