"Call to undefined method PHPUnit\Framework\TestSuite::sortId()" Error while executing Test Case with Coverage

Viewed 53

Call to undefined method PHPUnit\Framework\TestSuite::sortId()

Getting this error while trying to execute test case with coverage.

Command:

phpunit -v --debug ./Test.php --coverage-clover ../clover.xml

Putput: (first two lines)

PHPUnit 9.5.4 by Sebastian Bergmann and contributors.
Runtime:       PHP 7.3.33-1+ubuntu21.10.1+deb.sury.org+1
...
1 Answers

It appears that you have different installations of PHPUnit mixed up.

For instance, you may have used Composer to install PHPUnit and have configured the autoloader generated by Composer as PHPUnit's bootstrap script but then you invoke PHPUnit using an executable other than vendor/bin/phpunit.

Related