简体   繁体   中英

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.

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...

for reference check out: https://github.com/symfony/symfony/tree/master/src/Symfony/Bundle/FrameworkBundle/Test

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM