2014-04-01 42 views
2

Phing和PHPUnit都是从ubuntu 12.04上的pear安装的。如何告诉Phing PHPUnit的安装位置?

PHPUnit的位于在/ usr/bin中/ PHPUnit的和/ usr/bin中是Unix路径上,也对在php.ini

我怎么知道Phing在安装PHPUnit的include_path中?

[email protected]:~/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'属性吗? –

+0

你能帮我吗。有一个开放的赏金我的问题http://stackoverflow.com/questions/36405597/unable-to-globally-install-older-version-of-phpunit-phar –

回答

1

回答我自己的问题,我认为这台机器上的PHP版本可能太旧,无法处理PHAR档案。或者,也许PHAR配置被破坏。 PHPUnit通过PEAR在本机上安装为PHAR。

用于我的解决方法是在目标,这工作不使用<phpunit><exec>

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

我不是现在解决这个,我期待着在新的机器,将工作开箱即用。

+0

pharlocation工作对我来说很好。 –