Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Errors in PHPUnit itself

    PHP Notice:  Please no longer include "PHPUnit/Framework.php". in /usr/share/php/PHPUnit/Framework.php on line 50

Fatal error: Class 'PHPUnit_Runner_StandardTestSuiteLoader' not found in /usr/share/php/PHPUnit/TextUI/TestRunner.php on line 434
PHP Fatal error:  Class 'PHPUnit_Runner_StandardTestSuiteLoader' not found in /usr/share/php/PHPUnit/TextUI/TestRunner.php on line 434
/var/www/nrka2/build/build.xml:30: exec returned: 255
BUILD FAILED (total time: 2 seconds)

Hello I got this error in the latest phpUnit version. Any ideas how to solve it?

like image 876
sanders Avatar asked Feb 27 '26 19:02

sanders


2 Answers

Change your inclusion to PHPUnit/Autoload.php.

like image 165
Damien Avatar answered Mar 01 '26 09:03

Damien


Look in your folder that contains your tests.

For example, in Symfony2, there is a Tests folder under each bundle folder. Then you have to browse through the sub directories until you find the test file

e.g. login_databaseTest.php

You will see a line require_once 'PHPUnit/Framework.php';

Use a good IDE that has a search feature and search your entire project.

I originally though this was some file in the PHPUnit directory, under PHP. Not so. The files needing modified are generated test files that include this line needing modified.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!