我使用PHP的Yii框架来运行功能测试。我已经安装了PHPUnit_Story。
pear install phpunit/PHPUnit_Story
扩展程序已经存在。
/usr/share/php/PHPUnit/Extensions/Story
但是我遇到了错误:
PHP Warning: include(PHPUnit_Extensions_Story_TestCase.php): failed to open stream: No such file or directory in /var/www/yii/framework/YiiBase.php on line 427
PHP Stack trace:
PHP 1. {main}() /usr/bin/phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:581
PHP 3. PHPUnit_TextUI_Command->run() phar:///usr/bin/phpunit/phpunit/TextUI/Command.php:132
PHP 4. PHPUnit_TextUI_TestRunner->doRun() phar:///usr/bin/phpunit/phpunit/TextUI/Command.php:179
PHP 5. PHPUnit_TextUI_ResultPrinter->printResult() phar:///usr/bin/phpunit/phpunit/TextUI/TestRunner.php:425
PHP 6. PHPUnit_TextUI_ResultPrinter->printFailures() phar:///usr/bin/phpunit/phpunit/TextUI/ResultPrinter.php:177
PHP 7. PHPUnit_TextUI_ResultPrinter->printDefects() phar:///usr/bin/phpunit/phpunit/TextUI/ResultPrinter.php:322
PHP 8. PHPUnit_TextUI_ResultPrinter->printDefect() phar:///usr/bin/phpunit/phpunit/TextUI/ResultPrinter.php:243
PHP 9. PHPUnit_TextUI_ResultPrinter->printDefectTrace() phar:///usr/bin/phpunit/phpunit/TextUI/ResultPrinter.php:254
PHP 10. PHPUnit_Util_Filter::getFilteredStacktrace() phar:///usr/bin/phpunit/phpunit/TextUI/ResultPrinter.php:290
PHP 11. PHPUnit_Util_Blacklist->isBlacklisted() phar:///usr/bin/phpunit/phpunit/Util/Filter.php:105
PHP 12. PHPUnit_Util_Blacklist->initialize() phar:///usr/bin/phpunit/phpunit/Util/Blacklist.php:74
PHP 13. class_exists() phar:///usr/bin/phpunit/phpunit/Util/Blacklist.php:110
PHP 14. spl_autoload_call() phar:///usr/bin/phpunit/phpunit/Util/Blacklist.php:110
PHP 15. YiiBase::autoload() phar:///usr/bin/phpunit/phpunit/Util/Blacklist.php:0
PHP Warning: include(): Failed opening 'PHPUnit_Extensions_Story_TestCase.php' for inclusion (include_path='.:/var/www/yii-example/protected/components:/var/www/yii-example/protected/models:/usr/share/php:/usr/share/pear') in /var/www/yii/framework/YiiBase.php on line 427
PHP Stack trace:
PHP 1. {main}() /usr/bin/phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:581
PHP 3. PHPUnit_TextUI_Command->run() phar:///usr/bin/phpunit/phpunit/TextUI/Command.php:132
PHP 4. PHPUnit_TextUI_TestRunner->doRun() phar:///usr/bin/phpunit/phpunit/TextUI/Command.php:179
PHP 5. PHPUnit_TextUI_ResultPrinter->printResult() phar:///usr/bin/phpunit/phpunit/TextUI/TestRunner.php:425
PHP 6. PHPUnit_TextUI_ResultPrinter->printFailures() phar:///usr/bin/phpunit/phpunit/TextUI/ResultPrinter.php:177
PHP 7. PHPUnit_TextUI_ResultPrinter->printDefects() phar:///usr/bin/phpunit/phpunit/TextUI/ResultPrinter.php:322
PHP 8. PHPUnit_TextUI_ResultPrinter->printDefect() phar:///usr/bin/phpunit/phpunit/TextUI/ResultPrinter.php:243
PHP 9. PHPUnit_TextUI_ResultPrinter->printDefectTrace() phar:///usr/bin/phpunit/phpunit/TextUI/ResultPrinter.php:254
PHP 10. PHPUnit_Util_Filter::getFilteredStacktrace() phar:///usr/bin/phpunit/phpunit/TextUI/ResultPrinter.php:290
PHP 11. PHPUnit_Util_Blacklist->isBlacklisted() phar:///usr/bin/phpunit/phpunit/Util/Filter.php:105
PHP 12. PHPUnit_Util_Blacklist->initialize() phar:///usr/bin/phpunit/phpunit/Util/Blacklist.php:74
PHP 13. class_exists() phar:///usr/bin/phpunit/phpunit/Util/Blacklist.php:110
PHP 14. spl_autoload_call() phar:///usr/bin/phpunit/phpunit/Util/Blacklist.php:110
PHP 15. YiiBase::autoload() phar:///usr/bin/phpunit/phpunit/Util/Blacklist.php:0