0
votes

I am trying to use Xdebug/phpStorm to test a Drupal project. Installation seems to work (after quite a lot of work!). However when setting a breakpoint in phpStorm and doing a "Run", I get the error

PHP Fatal error:  Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in /home/hs/hellm/vendor/albertofem/rsync-lib/tests/AFM/Rsync/Tests/CommandTest.php:16
Stack trace:
#0 /home/hs/hellm/vendor/phpunit/phpunit/src/Util/FileLoader.php(65): include_once()
#1 /home/hs/hellm/vendor/phpunit/phpunit/src/Util/FileLoader.php(49): PHPUnit\Util\FileLoader::load()
#2 /home/hs/hellm/vendor/phpunit/phpunit/src/Framework/TestSuite.php(402): PHPUnit\Util\FileLoader::checkAndLoad()
#3 /home/hs/hellm/vendor/phpunit/phpunit/src/Framework/TestSuite.php(530): PHPUnit\Framework\TestSuite->addTestFile()
#4 /home/hs/hellm/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php(98): PHPUnit\Framework\TestSuite->addTestFiles()
#5 /home/hs/hellm/vendor/phpunit/phpunit/src/TextUI/Command.php(120): PHPUnit\Runner\BaseTestRunner->getTest()
#6 /home/hs/hellm/vendor/phpunit/phpunit/src/TextUI/Command.php(96): PHPUnit\TextUI\Command->run()
#7 /home/hs/hellm/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#8 {main}

I am at PHP 7.4, with PHPUnit 9.5.4, Drupal 9.1.8

1

1 Answers

1
votes

PHPUnit 9 does not have PHPUnit_Framework_TestCase anymore. Your test was likely written for an outdated version of PHPUnit that is no longer supported.