Category: functional-testing

Testing Controllers in Symfony 4.4 while using annotations

I’m facing a problem of testing my Controllers in Symfony 4.4 with FOSRestBundle & JMSSserializer. My controllers are pretty simple, usually containing nothing but call to another services, but I’m using ParamConverter, Serializer, Deserializer etc. I’m never sure if fields…

requestStack getCurrentRequest is null in service while loading data with Doctrine-Fixture

So, this is my first post in stackoverflow, sorry if I missed some mandatory information. Let me explain the issue I’m facing. While trying to load data use Doctrine-fixture command: php bin/console doctrine:fixture:load -e test, I’m getting the following error:…

Can’t create test that extends WebTestCase in Symfony

I’m having difficulty creating functional test for my bundle. Whenever I create a test class that extends SymfonyBundleFrameworkBundleTestWebTestCase and launch bin/phpunit, I get following error: Fatal error: Cannot declare class <MyTestClass>, because the name is already in use in <path/to/my/test/class>…