I have developped some bundles i.e. https://github.com/975L/EmailBundle and I want to add tests for them. So, I have created the file Tests/Service/EmailServiceTest.php
that contains one test.
I have installed phpunit using sudo apt install phpunit
on my Ubuntu computer, but when I cd
to my bundle's folder and run phpunit
I have the following error:
1) c975L\EmailBundle\Tests\Service\EmailServiceTest::testCreateEmailObject Error: Class 'c975L\EmailBundle\Service\EmailService' not found
It looks like the autoload can't find the class, even if declared at the top with use
.
I saw some solutions over the web that requires to create a bootstrap.php
with autoload but even with this, it doesn't work...
So my question is how do we test a standalone Symfony Bundle with phpunit?