[英]I'm trying to use KernetTestKase in my unit tests, but I get a “not found” error
I'm trying to follow some examples of using KernetTestCase for a Symfony 2 test that touches the DB. 我正在尝试遵循一些示例,这些示例使用KernetTestCase进行涉及数据库的Symfony 2测试。
I get this error: 我收到此错误:
Fatal error: Class 'Symfony\\Bundle\\FrameworkBundle\\Test\\KernelTestCase' not found in...
In my test files I have: 在我的测试文件中,我有:
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
and 和
class AcmeContestTest extends KernelTestCase
However I still get the error above when running tests... 但是在运行测试时我仍然收到上面的错误...
I figured out that Symfony version 2.3 which I'm using doesn't have KernelTestCase extracted out of WebTestCase as Symfony version 2.5 has... 我发现我正在使用的Symfony 2.3版没有从WebTestCase中提取KernelTestCase,因为Symfony 2.5版具有...
for reference check out: https://github.com/symfony/symfony/tree/master/src/Symfony/Bundle/FrameworkBundle/Test 供参考,请查看: https : //github.com/symfony/symfony/tree/master/src/Symfony/Bundle/FrameworkBundle/Test
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.