PHP单元测试-项目类包含一次错误

PHP单元测试-项目类包含一次错误,php,phpunit,Php,Phpunit,我创建了一些测试,但运行它们时出现问题 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[] = dirna

我创建了一些测试,但运行它们时出现问题

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','');
在bootstrap中,我有:
定义(“基本路径”、str\u替换(“\\\”、“/”、目录名(\uuuu文件\uuuuuuuuu));
//获取包含路径的数组
$include_parts=explode(路径分隔符,get_include_PATH());
//扩展路径
$include_parts[]=dirname(dirname(BASE_PATH))//这是…//
//重新编译路径并设置它们
设置包含路径(内爆(路径分隔符,$include_parts));
/**
*测试phpunit是否在PHP5.3或更高版本上运行
*/

版本比较(PHP_VERSION,'5.3',“您正在使用绝对路径包含
abc.PHP
,因此包含路径将被忽略。您的文件系统中是否确实包含
/private/config/abc.PHP

您包含的是
/private/config/abc.PHP'
,因此包含路径并不重要

这可能有两个原因:

  • 你只是有一个打字错误(因此我的评论看到这行)
  • 或者您缺少一个define,而您的行读取的是
    $path./private…
    ,但由于某种原因,
    $path
    为空,因此include失败

请将LineupTest.php的第3行粘贴到这里好吗?顺便说一句,
exit
获取一个退出代码(整数)。您可能希望
die
在这里返回一个错误退出代码并显示消息。是的,这也是我的想法(因此是注释)。如果您不介意的话,我无论如何都会回答;)