PHPStorm 8 + PHPUnit 4.2.6 Error

后端 未结 3 1573
清酒与你
清酒与你 2021-01-19 21:45

I can\'t make PHPUnit 4.2.6 to work with PHPStorm 8.

PHPUnit is loaded as phar inside PHPStorm 8 settings.

Whenever i try t

3条回答
  •  遥遥无期
    2021-01-19 22:01

    Here is how to "unhack" the IDE to run with phpnunit.phar (4x+) nicely on windows and linux!

    1. Download phpunit.phar under php, set your phar location from the IDE -> settings -> phpunit and phar location. THEN CLOSE IDE
    2. Find where your plugin files are, for php on windows this would be :\Program Files (x86)\JetBrains\PhpStorm 8.0.3\plugins\php\lib.
    3. Open php.jar with winrar and open scripts/phpunit.php.
    4. Comment out all PHPUnit/… require statements, so autoloader can do its job instead of using hardcoded values.
    5. Go to public static function init() method.
    6. Find the if section with a comment at the end says “awful hack”, screenshot.
    7. Remove all the amateur hacky stuff and replace it with this, screenshot.
    8. Save the file, Winrar will prompt you to save the archive, SAVE that one too.
    9. Run IDE And Run your tests, coverage. Enjoy!

    Hope this helps some of you out there. I will post the information to their forums as well.

提交回复
热议问题