Why, Fatal error: Class 'PHPUnit_Framework_TestCase' not found in ...?

Alvin picture Alvin · May 20, 2011 · Viewed 141.5k times · Source

Why I'm getting this PHP error?

Fatal error: Class 'PHPUnit_Framework_TestCase' not found in ...

Answer

shadi picture shadi · Mar 2, 2017

For those arriving here after updating phpunit to version 6 or greater released on 2017-02-03 (e.g. with composer), you may be getting this error because phpunit code is now namespaced (check changelog).

You will need to refactor things like \PHPUnit_Framework_TestCase to \PHPUnit\Framework\TestCase