ReflectionException: Class Tests\Unit\Symfony\Component\HttpKernel\Exception\NotFoundHttpException does not exist

Running unit tests in Laravel, I was getting this error:

ReflectionException: Class Tests\Unit\Symfony\Component\HttpKernel\Exception\NotFoundHttpException does not exist

The issue was missing root backslash, make sure you have expected exception like:

$this->expectException(\Symfony\Component\HttpKernel\Exception\NotFoundHttpException::class);

Published on

Previous post: Working Remotely

Next post: iPad Pro for Programming & Fun