我该如何告诉Phing PHPUnit安装的位置?

3

在Ubuntu 12.04上,Phing和PHPUnit都是通过pear安装的。

PHPUnit位于/usr/bin/phpunit,/usr/bin在Unix路径上,并且还出现在PHP.INI中的include_path里。

我如何告诉Phing PHPUnit的安装位置?

webroot@gm3:~/med1/pub$ phing utest
Buildfile: /home/webroot/med1/pub/build.xml

myproject > utest:

     [echo] Unittests PHPUnit...
Execution of target "utest" failed for the following reason: /home/webroot/med1/pub/build.xml:8:40: /home/webroot/med1/pub/build.xml:8:40: PHPUnitTask requires PHPUnit to be installed

BUILD FAILED
/home/webroot/med1/pub/build.xml:8:40: /home/webroot/med1/pub/build.xml:8:40: PHPUnitTask requires PHPUnit to be installed
Total time: 0.1148 seconds

1
可能是 http://stackoverflow.com/questions/23377750/phing-cant-see-phpunit 的重复问题?你尝试设置 pharlocation 属性了吗? - Sandeepan Nath
请问你能帮我吗?我的问题在stackoverflow上有一个开放的赏金。http://stackoverflow.com/questions/36405597/unable-to-globally-install-older-version-of-phpunit-phar - Sandeepan Nath
1个回答

1

回答我的问题,我认为这台机器上的PHP版本可能太旧了,无法处理PHAR归档文件。或者PHAR配置已经损坏。PHPUnit是通过PEAR在这台机器上安装为PHAR。

对我来说的一个解决方法是不使用<phpunit>而是在目标中使用<exec>,这个方法可行:

<target name="test">
  <exec command="phpunit --bootstrap tests/bootstrap.php --configuration tests/phpunit.xml">
    ...  

我现在不打算修复这个问题,但我期望在新机器上它会自动解决。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接