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
Highlighted
M1 Certified

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 ?

2 REPLIES
Moderator

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).

--
If the answer is useful, please give "Kudos" or "Accept as Solution".
M1 Certified

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.