Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 489244 - dev-php/phing-2.4.9 - dev-php/phpunit-3.7.20 integration broken
Summary: dev-php/phing-2.4.9 - dev-php/phpunit-3.7.20 integration broken
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-24 08:58 UTC by Eliovir
Modified: 2014-10-10 20:47 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
build.xml sample to test PHPUnit integration. (build.xml,523 bytes, text/xml)
2013-10-24 08:58 UTC, Eliovir
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eliovir 2013-10-24 08:58:41 UTC
Created attachment 361770 [details]
build.xml sample to test PHPUnit integration.

Hi,

I've got a build.xml containing a PHPUnit task.

After updating phpunit, which use PHAR for now, the task breaks PHPUnit execution:

    BUILD FAILED
    Error reading project file [wrapped: build.xml:373:34: PHPUnitTask requires PHPUnit to be installed]

Note:

    $ qlist phpunit
    /usr/share/php/phpunit/phpunit.phar
    /usr/bin/phpunit

If, to the file /usr/share/php/phing/tasks/ext/phpunit/PHPUnitTask.php, I add
    include 'phpunit/phpunit.phar';
the class, PHPUnit_Runner_Version is found and no BuildException is raised, but phpunit.phar is run, so phing stops.

If I add,
    set_include_path('phar:///usr/share/php/phpunit/phpunit.phar' . PATH_SEPARATOR . get_include_path());
Phing fails with
    [PHP Error] require_once(PHPUnit/Autoload.php): failed to open stream: No such file or directory [line 22 of /usr/share/php/phing/tasks/ext/phpunit/PHPUnitTestRunner.php]

as phpunit.phar does not contain this file.

Thanks
Comment 1 Matti Bickel (RETIRED) gentoo-dev 2014-01-04 19:53:18 UTC
I've tested this with the 2.6.1 version I just added to the tree and was able to use phpunit just fine. Can you reproduce with the new version?
Comment 2 Eliovir 2014-01-06 10:25:58 UTC
Hi,

I still have the same problem:

    $ wget "https://489244.bugs.gentoo.org/attachment.cgi?id=361770" -O build.xml
    $ phing -l

Buildfile: build.xml
[PHP Error] require_once(PHPUnit/Autoload.php): failed to open stream: No such file or directory [line 22 of /usr/share/php/phing/tasks/ext/phpunit/PHPUnitTestRunner.php]
PHP Fatal error:  require_once(): Failed opening required 'PHPUnit/Autoload.php' (include_path='phar:///usr/share/php/phpunit/phpunit.phar:/usr/share/php/../classes:.:/usr/share/php5:/usr/share/php') in /usr/share/php/phing/tasks/ext/phpunit/PHPUnitTestRunner.php on line 22

Fatal error: require_once(): Failed opening required 'PHPUnit/Autoload.php' (include_path='phar:///usr/share/php/phpunit/phpunit.phar:/usr/share/php/../classes:.:/usr/share/php5:/usr/share/php') in /usr/share/php/phing/tasks/ext/phpunit/PHPUnitTestRunner.php on line 22

    $ emerge --info dev-php/phpunit dev-php/phing

[..]
dev-php/phpunit-3.7.20 was built with the following:
USE=""

dev-php/phing-2.6.1 was built with the following:
USE="minimal (multilib)" ABI_X86="64"


I've tried after emerging phing with USE="-minimal" :

    $ phing -l

Buildfile: build.xml

BUILD FAILED
Error reading project file [wrapped: build.xml:5:34: PHPUnitTask requires PHPUnit to be installed]
Total time: 0.0682 seconds
Comment 3 Marcin Sochoń (soki) 2014-08-30 16:53:37 UTC
I have same problem. phing-2.6.1 phpunit-3.7.20
Comment 4 Brian Evans (RETIRED) gentoo-dev 2014-10-10 20:47:55 UTC
Just added dev-php/phing-2.8.2 which works with the phpunit phar file.

You will need to add a pharlocation attribute for it to work.