cancel
Showing results for 
Search instead for 
Did you mean: 

php bin/magento setup:di:compile stumbles uppon PSR0 namespace for PhpUnit and fails.

SOLVED

php bin/magento setup:di:compile stumbles uppon PSR0 namespace for PhpUnit and fails.

Hi there, i want to run "setup:di:compile"

And i get the following error:

 

Fatal error: Class 'PHPUnit_Framework_TestCase' 
not found in vendor\magento\module-tax-sample-data\Test\Model\TaxTest.php on line 32

 

How is it possible that i see a PSR0 namespace in a Magento 2 core module ?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: php bin/magento setup:di:compile stumbles uppon PSR0 namespace for PhpUnit and fails.

Hi @RogerGetnoticed,


Which version of PHP are you using? (I don't have a final answer but I've read some issues with PHP 7.1 and some old versions of PHPUnit).

View solution in original post

2 REPLIES 2

Re: php bin/magento setup:di:compile stumbles uppon PSR0 namespace for PhpUnit and fails.

Hi @RogerGetnoticed,


Which version of PHP are you using? (I don't have a final answer but I've read some issues with PHP 7.1 and some old versions of PHPUnit).

Re: php bin/magento setup:di:compile stumbles uppon PSR0 namespace for PhpUnit and fails.

I have found the problem. There are a lot of dependencies in M2 and one of them didn't upgrade to the correct PhpUnit version. So, there was 5.x and 6.x used at the same time. I just removed the dependency temporary bij removing the complete folder. Generated (with a command that is 'compile') the new classes and worked as expected. Didn't need the whole magento, just enough to run my tests.