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

后端 未结 13 1150
攒了一身酷
攒了一身酷 2020-11-29 19:23

Why I\'m getting this PHP error?

Fatal error: Class \'PHPUnit_Framework_TestCase\' not found in ...
13条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-29 20:06

    For higher version of phpunit such as 6.4 You must use the namespace PHPUnit\Framework\TestCase

    use TestCase instead PHPUnit_Framework_TestCase

    // use the following namespace
    use PHPUnit\Framework\TestCase;
    
    // extend using TestCase instead PHPUnit_Framework_TestCase
    class SampleTest extends TestCase {
    
    }
    

提交回复
热议问题