9. Oct 2022 |

Class ‘phpunit’ could not be found

Created new Laravel project by composer create-project laravel/laravel example-app. Trying to run tests/Feature/ExampleTest.php in PhpStorm and I get an error Class 'phpunit' could not be found in '/home/robert/phpunit-test-app/vendor/phpunit/phpunit/phpunit'. What does it even mean?! 😀 There are no answers on Google at the moment and this post will probably rank well.


For some reason my CLI interpreter did not make any sense. It took me quite a few hours to figure it out.