I am trying to inject @validator into my service but LiipFunctionalTestBundle is overriding that service when it gets injected.
admin.image_service:
class: AdminBundle\Service\ImageService
arguments: ["@validator", "@doctrine.orm.admin_entity_manager", "@image_storage_filesystem"]
Which results in the error
must be an instance of Symfony\Component\Validator\Validator\RecursiveValidator, instance of Liip\FunctionalTestBundle\Validator\DataCollectingValidator given
running php bin/console debug:container results in
liip_functional_test.validator: Liip\FunctionalTestBundle\Validator\DataCollectingValidator
validator: alias for "liip_functional_test.validator"
Is there a way to get around this over than remove liip and refactor all of my tests?
In Your service you should typehint Interface
not exact class.
Instdead Symfony\Component\Validator\Validator\RecursiveValidator
use Symfony\Component\Validator\Validator\ValidatorInterface
- which is implemented by both classes (Symfony and Liip).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With