Eclipse PDT & PHPUnit?

后端 未结 13 1260
野的像风
野的像风 2021-01-30 17:35

Is there any integration of PHPUnit with Eclipse PDT?

If not, are there any plans to do so?

相关标签:
13条回答
  • 2021-01-30 17:50

    For all using composer on unix like machine (eclipse and xdebug installed):

    cd <project-root>
    ln -s vendor/bin/phpunit phpunit.php
    

    Open eclipse, open run/debug configuration, create a new debug configuration, and select phpunit.php as file to debug. Continue the rest of the setup as usual, set breakpoints, that's it.

    0 讨论(0)
  • 2021-01-30 17:54

    Sebastian Bergmann did approach pdt back in 2006... but with no obvious result.
    And his latest entries on his blog only mention PHPEdit 2.12 and Zend Studio.

    The only testing framework officially documented on the PDT side is the "PDT Testing Framework", and it does not seem actively maintained...

    So, no. There does not seem to be any plan to actively integrate PHPUnit in PDT anytime soon.

    0 讨论(0)
  • 2021-01-30 17:56

    Following @DavidWinterbottom response (Eclipse Indigo):

    1. Select the Run -> External Tools -> External tools configurations

    2. Create a new program

    3. Set the Location to point to your executable (/usr/bin/phpunit on Linux, or path to phpunit.bat on Windows)

    4. Set the Arguments to absolute path to your phpunit folder (C:\phpproject\testunit)

    I couldn't make get it to using ${project_loc} or ${project_path}.

    0 讨论(0)
  • 2021-01-30 17:57

    I tried PHP Unit in Eclipse and was not happy with the configuration issues. I switched to NetBeans PHP IDE. I recommend NetBeans PHP IDE for PHP Unit testing. http://www.netbeans.org/kb/docs/php/phpunit.html

    0 讨论(0)
  • 2021-01-30 17:58

    See Eclipse Plugin PHP Tool Integration (PTI) which provides integration of following features for Eclipse:

    • PHP_CodeSniffer
    • PHPUnit
    • PHP Depend
    • PHP Copy/Paste Detector

    Update sites (Help - Install Software - Add ...):

    Latest stable release: http://www.phpsrc.org/eclipse/pti/

    Development version: http://www.phpsrc.org/eclipse/pti-dev/

    0 讨论(0)
  • 2021-01-30 18:01

    Using phpunit from Ant also is possible, and Ant is natively supported by Eclipse. Simple have a new <exec executable="phpunit"> in a target and voilà, you can use phpunit in eclipse, through ant.

    0 讨论(0)
提交回复
热议问题