mit
mit

Reputation: 11271

How do I tell Phing where PHPUnit is installed?

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

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

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

Upvotes: 3

Views: 1612

Answers (1)

mit
mit

Reputation: 11271

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.

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.

Upvotes: 1

Related Questions