PHP Fatal error: Uncaught Error: Class 'CakeTestSuite' not found in

1.2k views Asked by At

I'm new to PHP and I got existing CakePHP project but I cannot start it from PHP Storm. Every time I want to run app it shows error:

PHP Fatal error: Uncaught Error: Class 'CakeTestSuite' not found in C:\xampp\htdocs\dummy\dummy_app\Plugin\AclExtras\Test\Case\AllTestsTest.php:16

AllTestsTest.php file:

require_once 'PHPUnit/Autoload.php';

class AllTestsTest extends PHPUnit_Framework_TestSuite {


    public static function suite() {
        $suite = new CakeTestSuite('All Tests');
        $suite->addTestDirectoryRecursive(App::pluginPath('AclExtras') . 'Test' . DS . 'Case' . DS);

        return $suite;
    }
}

Error is set to: $suite = new CakeTestSuite('All Tests');

Any ideas why or how to fix this?

1

There are 1 answers

1
ndm On

CakePHP 2.x testsuites cannot be run directly via PHPUnit, it requires CakePHPs custom autoloader and uses a custom test runner. You have to use the CakePHP test shell instead.

./Console/cake test AclExtras

See also