Saturday, November 17, 2018

Using Symfony 4, PHPUnit, and PHPStorm

It took me a few minutes to work out how to be able to run PHP Unit from within PHPStorm for my new Symfony 4.1 project.Here's the configuration that ultimately worked, with no fiddling of any configuration files or changes to my symfony code of any kind.

The relevant part of the Path to phpunit.phar is:<your-project-directory>/bin/.phpunit/phpunit-6.5/phpunitYou'll receive something along the lines ofFatal error: Class 'Symfony\Bundle\FrameworkBundle\Test\KernelTestCase' not foundwhen running your unit tests if you haven't checked the 'Default configuration file' box.