6

In earlier versions, it was possible to debug any unit test within functionality provided by PHPStorm. How should I run debug session on a particular test using vendor/bin/simple-phpunit?

3
  • I run it the same way (locally), just changed "path to phpunit.phar" in Setings -> Languages & frameworks -> PHP -> Test frameworks to simple-phpunit Commented Apr 9, 2018 at 6:00
  • @NikitaU. — but PHPstorm screamed that phpunit couldn't be found. However, I noticed that phpunit has been installed in hidden (.phpunit) directory inside vendor. Commented Apr 9, 2018 at 10:59
  • Unfortunately, simple-phpunit starts an another sub-process so debugging is weird. Still working on this. Commented Apr 9, 2018 at 18:40

1 Answer 1

7

It's a bit hidden right now.

  1. Run vendor/bin/simple-phpunit to fetch some not-so-visible dependencies,
  2. Setup a new test framework within PHPStorm using this path: /vendor/bin/.phpunit/phpunit-5.7/phpunit with path to composer.phar checked. Keep in mind not to forget specifying phpunit.xml as default configuration to provide autoloaders,
  3. All now works.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.