问题
I'm able to run my individual tests for each model in a plugin called Agg, but when I try to run a CakeTestSuite, then I get an error.
class ModelsTest extends CakeTestSuite
{
public static function suite()
{
$suite = new CakeTestSuite('All model tests');
$suite->addTestDirectory(TESTS . 'Case' . DS . 'Model');
return $suite;
}
}
Running that suite generates this error.
Fatal error: Class 'PHPUnit_Util_Skeleton_Test' not found in C:\work\zend\cake\Cake\TestSuite\CakeTestSuiteCommand.php on line 77
I'm using PHP 5.3.15 and have PHPUnit 3.7.12 installed with CakePHP 2.2.5
I get this error when running tests both via the web and the CLI.
Any help would be appreciated.
UPDATE:
If I search for 'PHPUnit_Util_Skeleton_Test' in PEAR folder for PHPUnit it's not found. This seems strange to me. Am I using the wrong version of PHPUnit? When was this class introduced?
UPDATE:
It seems that this class is no longer used in PHPUnit 3.7.x, and I'm wondering if CakePHP 2.2 will only work with PHPUnit 3.6. I tried to uninstall the pear package, and then install the 3.6.x version but always installs the newest version. Any ideas on how to downgrade PHPUnit?
UPDATE:
Downgrading using the --force to install older versions of PHPUnit didn't resolve the problem. I tried 3.6.12, 3.6.5 and 3.5. With the 3.6.12 I got an error with is_file() somewhere in the PHPUnit code.
回答1:
PHPUnit_Util_Skeleton_Test
is available in PHPUnit 3.6, see https://github.com/sebastianbergmann/phpunit/blob/3.6/PHPUnit/Util/Skeleton/Test.php
I suggest uninstalling all phpunit packages and reinstalling phpunit 3.6 with
$ pear install phpunit/phpunit-3.6.12
It might be that dependencies were broken when downgrading the single phpunit package with --force
, and this should fix it.
来源:https://stackoverflow.com/questions/14348318/phpunit-util-skeleton-test-not-found-in-cakephp