Closed sprankhub closed 3 years ago
Hi @sprankhub ,
Please follow instructions on "TestCase not found" the following doc to resolve this: https://docs.shipperhq.com/troubleshooting-magento-2-installations/#TestCase_not_found_Compiler_Error
Thank you.
The extension is installed via composer and the error occurs when running the tests. Magento 2.3 has a newer version of PHPUnit installed, which now uses namespaces. Hence, the tests need to be adjusted to be compatible. Would you accept a PR fixing this? Mind that the tests would then not work any more for older versions of Magento though.
Hi, @sprankhub from your explanation it sounds like the extension was installed via zip and then composer which what resulted in that issue. You shoudln't have any test files installed. We recommend to re-install the extension using a composer.
Complete steps to reproduce:
mkdir wsatest
composer init
composer require webshopapps/module-matrixrate
phpunit vendor/webshopapps/module-matrixrate/Test/
This results in the above mentioned error. The issue is, as said, that newer versions of PHPUnit (like 6.5.14 in my example) switches to namespaces and the class PHPUnit_Framework_TestCase
does not exist any more. See https://phpunit.de/announcements/phpunit-6.html.
Any updates on this ?
Hi, Our developers are aware and will update the tests for a future version. The unit tests are not required for the module to function, to clarify.
As a temporary fix you can create a PHP file containing:
class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase');
And add it to composer.json:
{ "autoload": { "files": ["src/MyLibrary/functions.php"] } }
Copyright outlaw GPlanchat for the trick
Thanks for raising this and your patience. This will be resolved in the next release which should be available in the next week