I use Yii 1.1.14 and codeception api testing. I added the "c3.php" in head of my index-test.php as below:
<?php
/**
-
This is the bootstrap file for test application.
-
This file should be removed when the application is deployed for production.
*/
include DIR.’/protected/tests/codeception/c3.php’;
// change the following paths if necessary
$yii=dirname(FILE).’/../framework/yii.php’;
$config=dirname(FILE).’/protected/config/test.php’;
// remove the following line when in production mode
defined(‘YII_DEBUG’) or define(‘YII_DEBUG’,true);
require_once($yii);
Yii::createWebApplication($config)->run();
/////////////////////////////////////////////////////////////////////////////////////////////////
When I’m running the code coverage, some of the tests are passed but some are failed:
Array
(
[code] => 500
[type] => PHP warning
[message] => include(PHP_Invoker.php): failed to open stream: No such file or directory
[file] => /Users/qixiaobin/web/framework/YiiBase.php
[line] => 427
[trace] => #0 /Users/qixiaobin/web/framework/YiiBase.php(427): autoload()
#1 unknown(0): autoload()
#2 unknown(0): spl_autoload_call()
#3 phar:///Users/qixiaobin/web/tripplusme-new/protected/tests/codeception/codecept.phar/vendor/phpunit/php-code-coverage/src/CodeCoverage/Filter.php(319): class_exists()
#4 phar:///Users/qixiaobin/web/tripplusme-new/protected/tests/codeception/codecept.phar/vendor/phpunit/php-code-coverage/src/CodeCoverage/Filter.php(306): PHP_CodeCoverage_Filter->addDirectoryContainingClassToBlacklist()
#5 phar:///Users/qixiaobin/web/tripplusme-new/protected/tests/codeception/codecept.phar/vendor/phpunit/php-code-coverage/src/CodeCoverage/Filter.php(259): PHP_CodeCoverage_Filter->prefillBlacklist()
#6 phar:///Users/qixiaobin/web/tripplusme-new/protected/tests/codeception/codecept.phar/vendor/phpunit/php-code-coverage/src/CodeCoverage.php(518): PHP_CodeCoverage_Filter->isFiltered()
#7 phar:///Users/qixiaobin/web/tripplusme-new/protected/tests/codeception/codecept.phar/vendor/phpunit/php-code-coverage/src/CodeCoverage.php(287): PHP_CodeCoverage->applyListsFilter()
#8 phar:///Users/qixiaobin/web/tripplusme-new/protected/tests/codeception/codecept.phar/vendor/phpunit/php-code-coverage/src/CodeCoverage.php(260): PHP_CodeCoverage->append()
#9 /Users/qixiaobin/web/tripplusme-new/protected/tests/codeception/c3.php(233): PHP_CodeCoverage->stop()
#10 unknown(0): {closure}()
[version] => PHP 5.5.19 Development Server <a href="http://www.yiiframework.com/">Yii Framework</a>/1.1.14
[time] => 2015-06-18 10:15:05
[admin] => the webmaster
)
It seems that there are something broken about the autoload.
Anyone can help?