2

just made upgrade to 2.3.0 and while compilation get this error:

server@server:~/web/server.dev.company.com/public_html$ /usr/bin/php7.1 bin/magento setup:di:compile
    Compilation was started.
    Repositories code generation... 1/7 [====>-----------------------]  14% 1 sec 68.0 MiBPHP Fatal error:  Class 'PHPUnit_Framework_TestCase' not found in /home/server/web/server.dev.company.com/public_html/app/code/WebShopApps/MatrixRate/test/Unit/Block/Adminhtml/Form/Field/ImportTest.php on line 36

I try to remove this module, but it not solve this trouble.

  • 1
    PHP version 7.1.26; composer.json -> "phpunit/phpunit": "~6.2.0", – dukir Feb 21 '19 at 10:44
5

If you're using PHPUnit version 6, please replace class 'PHPUnit_Framework_TestCase' in your test file to 'PHPUnit\Framework\TestCase'. So it'd look like this:

class YourTest extends \PHPUnit\Framework\TestCase {
    ...
}

Reference : https://github.com/magento/magento2/issues/11114

|improve this answer|||||
  • some vendor modules (M2.3.1) use the old class PHPUnit_Framework_TestCase – medmek Mar 29 '19 at 15:10
1

For this do some changes into file. Just change this code

class MatrixrateTest extends \PHPUnit_Framework_TestCase

to

class MatrixrateTest extends \PHPUnit\Framework\TestCase

into below files.

 Matrixrate/GridTest.php
 Form/Field/ExportTest.php
 Form/Field/ImportTest.php
 Config/Backend/MatrixrateTest.php
 Config/Source/MatrixrateTest.php

Than run compilation command your problem is sorted

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.