use PhpUnit\Framework\TestCase; Undefined class 'TestCase'. When using phpunit.phar

I am using PHPUnit via phpunit.phar file, the tests are running and working properly. But the IDE does not recognize the TestCase class as a result all assert methods are not recognized as well.

What should be done ?

3

Hi there,

In such cases the first solution would be:

1) Ensure that phpunit.phar is not excluded in any way

2) Try "File | Invalidate Caches..." and restart IDE.

If still nothing -- try with ALL custom (not bundled bu default) plugins disabled (try #2 after doing that).

0

Hello, you can try this: In File > Settings > PHP, in tab "include path", add the path to the folder of your phpunit.phar.

2

请先登录再写评论。