1

I installed Symfony 3 with the command line as they show in their documentation, and installed PHPUnit.

phpunit --version
PHPUnit 6.0.6 by Sebastian Bergmann and contributors.

When I run phpunit in the command line, I get this error:

PHP Fatal error:  Class 'PHPUnit_Framework_TestCase' not found in D:\symfony\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Test\KernelTestCase.php on line 23

Thanks in advance for any help

2 Answers 2

3

This is an issue related to PHPUnit 6 and a known 'bug' or incompatibility with Symfony (the background is that PHPUnit 6 expects and only supports PHP7 while Symfony 3 still supports lower PHP versions).

I suggest to use PHPUnit 5.7 as a workaround for now.

See this issue description/discussion on Github

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks @LBA for your answer, I'm using PHP7 in my server, and from here you can see that Symfony 3 is 100% compatible with PHP7
I just read it, and in the same time tried it with PHPUnit 5.6 and it's working, thank you
1

You can change PHPUnit to 5.7 version, as LBA suggest but this is not solution.

This error message simply tells you that you should replace:

use PHPUnit_Framework_TestCase;

with

use PHPUnit\Framework\TestCase;

works for me!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.