【发布时间】:2011-12-15 11:32:05
【问题描述】:
我创建了一些测试,但运行它们时出现问题
In bootstrap I have:
define("BASE_PATH",str_replace("\\","/",dirname(__FILE__)));
//Get an array of your include paths
$include_parts = explode(PATH_SEPARATOR,get_include_path());
//Extend the paths
$include_parts[] = dirname(dirname(BASE_PATH)); //this is ../../
//recompile the paths and set them
set_include_path(implode(PATH_SEPARATOR,$include_parts));
/**
* Test if phpunit running on php 5.3 or newer
*/
version_compare(PHP_VERSION, '5.3', '<') and exit('Test requires PHP 5.3 or newer.');
error_reporting(E_ALL & ~E_STRICT);
ini_set('display_errors', TRUE);
define('DOC_ROOT','');
运行测试时我收到警告
警告:include_once():打开失败 '/private/config/abc.php' 用于包含 (include_path='/usr/local/bin:/usr/local/lib/php/:.:/opt/docroot/shared:/export/home/john/public_html/sports') 在 /export/home/john/public_html/sports/private/tests/Football/Match/LineupTest.php 在第 3 行
出了什么问题,因为我看到了包含路径,我看到了我的目录。
【问题讨论】:
-
你能把 LineupTest.php 的第 3 行粘贴到这里吗?
-
顺便说一句,
exit采用退出代码(整数)。您可能希望这里的die返回错误退出代码并显示消息。