Phing can't see PHPUnit

前端 未结 4 1812
遥遥无期
遥遥无期 2021-01-22 16:43

I\'m trying to setup a new Continuous Integration server that utilizes Phing and PHPUnit for automatically running test cases.

I\'ve installed Phing with Pear:



        
相关标签:
4条回答
  • 2021-01-22 16:53

    It looks like there are some actual issues with phing and the latest 4.x versions of PHPUnit: http://www.phing.info/trac/ticket/1091.

    So to fix the issue, I removed PHPUnit 4 and specified an older version:

    pear install phpunit/PHPUnit-3.7.35
    

    Phing and PHPUnit worked immediately at this point.

    0 讨论(0)
  • 2021-01-22 16:57

    Maybe a silly remark, but do you have /usr/local/bin/phpunit in your PHP include path?

    I get the same error when I remove the location of phpunit.phar from my include path.

    0 讨论(0)
  • 2021-01-22 17:01

    Here is a guy with exactly the same problem: How do I tell Phing where PHPUnit is installed?

    His theory is that:

    PHP version on this machine could be too old and not be able to handle PHAR archives

    I can't comment if he is right or not, but that question received no replies from anyone other than the author

    0 讨论(0)
  • 2021-01-22 17:11

    Seems like adding the pharlocation attribute to the phpunit task element, pointing to your local phpunit executable, does the job:

    <phpunit haltonfailure="true" haltonerror="true" 
        bootstrap="./fw_init.php" 
        pharlocation="/usr/local/bin/phpunit">
            <formatter type="plain" usefile="false" />
            ...
    </phpunit>
    
    0 讨论(0)
提交回复
热议问题