如何告诉Phing PHPUnit安装在哪里? [英] How do I tell Phing where PHPUnit is installed?

查看:87
本文介绍了如何告诉Phing PHPUnit安装在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Phing和PHPUnit都是从ubuntu 12.04上的梨安装的.

Both Phing and PHPUnit were installed from pear on ubuntu 12.04.

PHPUnit位于/usr/bin/phpunit上,/usr/bin位于Unix路径上,也位于PHP.INI中的include_path上

PHPUnit is located at /usr/bin/phpunit and /usr/bin is on the unix path and also on the include_path in PHP.INI

如何告诉Phing PHPUnit安装在哪里?

How do I tell Phing where PHPUnit is installed?

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

推荐答案

回答我自己的问题,我认为这台计算机上的PHP版本可能太旧了,无法处理PHAR存档.或PHAR配置已损坏.通过PEAR将PHPUnit作为PHAR安装在此计算机上.

Answering my own question, I think the PHP version on this machine could be too old and not be able to handle PHAR archives. Or maybe the PHAR configuration is broken. PHPUnit is installed as PHAR on this machine via PEAR.

对我来说,一种解决方法是在目标中不使用<phpunit>而是使用<exec>

A workaround for me was to not use <phpunit> but <exec> in the target, which worked:

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

我暂时不解决此问题,我希望它在较新的机器上可以立即使用.

I am not fixing this for now and I am expecting on newer machines it will work out of the box.

这篇关于如何告诉Phing PHPUnit安装在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆