PhpUnit failing in PhpStorm w/ exit code 255 in Symfony 2 project

前端 未结 4 653
暗喜
暗喜 2020-12-11 04:25

I\'m having trouble getting phpunit working inside of a Symfony project in PhpStorm - phpunit -c app works fine in the OSX terminal.

Here is the error:

4条回答
  •  轮回少年
    2020-12-11 05:09

    Steps to make it work (test in PHPStorm 8.0.1):

    1) In Preferences > PHP > PHPUnit make sure that nothing is set for Default configuration file or default bootstrap file.

    2) Make a custom PHPUnit Configuration via Run > Edit Configurations > in the Command Line subsection, and be sure to:

    a) set Custom working directory: to be /absolute/path/to/vendor.

    b) check "Use alternative configuration file:" and set it to /absolute/path/to/vendor/your_app/(sub_app_if_applicable)/phpunit.xml.dist

    Then you can run any test class in the suite by specifying the class and file, or just check "Defined in the configuration file" to run all of them according to the config.

提交回复
热议问题