Grigory Ilizirov
Grigory Ilizirov

Reputation: 1018

PHPUnit in PhpStorm

PHPUnit in PhpStorm. Everything working great, but why do I have this error?

enter image description here

The Framework shown in red, and the IDE error says:

Undefined namespace Framework.

How to get rid of it ?

Upvotes: 1

Views: 489

Answers (2)

David H
David H

Reputation: 35

I had the same error. using phpunit.phar file

I fixed adding the file as External library screenshot

I have several versions of phar so I just selected "exclude phar from project" in the other files.

Upvotes: 0

simon.ro
simon.ro

Reputation: 3312

Phpunit introduced the namespace PHPUnit\Framework\TestCase with Version 6, early 2017 (see https://github.com/sebastianbergmann/phpunit/wiki/Release-Announcement-for-PHPUnit-6.0.0).

Check your PhpStorm settings, probably you configured a version prior to 6.0.0, so PhpStorm doesn't know that namespace.

Upvotes: 1

Related Questions