Tôi gặp sự cố nhỏ khi cố gắng chạy thử nghiệm PHPUnit trong IDE PhpStorm.Lỗi khi tôi thử chạy PHPUnit từ PhpStorm
tôi sử dụng tập tin nhạc sĩ mà trông:
{
"require": {
"phpunit/phpunit": "3.7.19"
}
}
Bây giờ khi tôi chạy thử nghiệm tôi recive ngoại lệ: PHP Fatal error: Uncaught exception 'PHPUnit_Framework_Exception' with message 'Class "PHPUnit_Extensions_RepeatedTest" does not extend PHPUnit_Framework_TestCase.'
Điều gì là sai? Khi tôi bao gồm thử nghiệm phiên bản cài đặt lê làm việc OK.
// EDIT mẫu lớp thử nghiệm:
class ReaderTest extends PHPUnit_Framework_TestCase
{
/**
* @test
*/
public function shouldGetReadedValue()
{
$this->assertTrue(true);
}
}
// EDIT2 Trace:
/usr/bin/php /tmp/ide-phpunit.php --no-configuration /path/to/my/project
Testing started at 14:53 ...
PHP Fatal error: Uncaught exception 'PHPUnit_Framework_Exception' with message 'Class "PHPUnit_Extensions_RepeatedTest" does not extend PHPUnit_Framework_TestCase.' in /path/to/my/project/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:183
Stack trace:
#0 /path/to/my/project/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php(315): PHPUnit_Framework_TestSuite->__construct(Object(ReflectionClass))
#1 /path/to/my/project/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php(389): PHPUnit_Framework_TestSuite->addTestSuite(Object(ReflectionClass))
#2 /path/to/my/project/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php(416): PHPUnit_Framework_TestSuite->addTestFile('/var/www/php-sh...')
#3 /path/to/my/project/vendor/phpunit/phpunit/PHPUnit/Runner/BaseTestRunner.php(96): PHPUnit_Framework_TestSuite->addTestFiles(Array)
#4 /path/to/my/project/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php(150): PHPUnit_Runner_BaseTestRunner->getTest('/var/www/php-sh...', '', A in /path/to/my/project/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php on line 183
Process finished with exit code 255
Bạn có thể hiển thị bài kiểm tra đơn vị của mình không? Lớp thử nghiệm của bạn có mở rộng PHPUnit_Framework_TestCase không? –
Tôi chỉnh sửa câu hỏi của mình và thêm lớp kiểm tra mẫu. Tôi có vài lớp thi. –