2013-10-16 62 views
0

我刚刚安装了phpunit通过梨安装,但我无法运行测试(已在另一台服务器上工作)。任何人都可以告诉我什么是我的配置中缺少的?Phpunit:测试没有运行“无法打开文件”错误

这里是输出phpunit xxxxTest.phpphpunit .命令:

$ phpunit getActTest.php 
X-Powered-By: PHP/5.3.8-pl0-gentoo 
Content-type: text/html 

PHPUnit 3.7.27 by Sebastian Bergmann. 

Cannot open file "getActTest.php". 

$ phpunit . 
X-Powered-By: PHP/5.3.8-pl0-gentoo 
Content-type: text/html 

PHPUnit 3.7.27 by Sebastian Bergmann. 



Time: 0 ms, Memory: 2.00Mb 

No tests executed! 
$ ls 
getActTest.php   getCirkwiReferencesTest.php getListObjectTest.php getLodgingTest.php getPoisTest.php  getRestosTest.php getVarsNConstTest.php 
getCirkwiExportTest.php getHomeTest.php    getLocalTest.php  getOthersTest.php getProfileTest.php getTeaserTest.php 
+0

在测试文件中看起来有些问题,基于",这通常是基于Web的编码。“从另一台计算机复制时是否注意保留格式化?另外,复制后检查文件权限。 –

+0

该文件使用GIT仓库进行转储,因此编码没有改变。我将权限更改为777,并且我仍然得到相同的结果。在我看来,这是一个PHPUnit安装问题,因为我很难将其安装在此Gentoo服务器上。不幸的是我仍然没有解决它。 – Thithi32

回答

0

看来你的文件路径将是不正确的。请确保您位于文件所在的目录中。然后运行运行ll列出文件,以确保您位于正确的目录中。现在运行phpunit xxxxTest.php,你会得到结果。

相关问题