简体   繁体   中英

PHPUnit with Symfony Fatal error: Class 'Doctrine\Bundle\DoctrineBundle\DoctrineBundle' not found

I'm trying to testing my app made with Symfony. I wrote a test and when I launch it, i get the following error:

Fatal error: Class 'Doctrine\\Bundle\\DoctrineBundle\\DoctrineBundle' not found in /.../app/AppKernel.php on line 17

I had the same error with Symfony's MonologBundle , AsseticBundle and SwiftmailerBundle : then I've manually added these bundles into my app, so pheraps I have fixed those errors, but with Doctrine I've not found any solutions yet.

It looks like maybe you did not install the Doctrine bundle. Try to go to the root of your project where the composer.phar is located through a console, and try to run it like this:

php composer.phar

It will install all dependencies of Symfony2,and hopefully everything is going to work :)

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