我已经使用以下命令成功设置了一个 symfony 3.2.4 项目:
symfony new symfony_test
cd symfony_test
composer require --dev phpunit/phpunit ^6.0
composer update
然后当我尝试运行默认测试时出现以下错误:
$ vendor/bin/phpunit tests/AppBundle/Controller/DefaultControllerTest.php
Fatal error: Class 'PHPUnit_Framework_TestCase' not found in C:\Users\po.louis\PhpstormProjects\test\symfony_test\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Test\KernelTestCase.php on line 23
我错过了什么?
最佳答案
在相同版本的框架上似乎还不可能,as announced in the last weekly update :
This week Symfony continued refactoring tests to make use of the new PHPUnit namespaces.
希望这将适用于所有受支持的版本。
关于phpUnit 与 Symfony,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42532448/