DEV Community

[Comment from a deleted post]
Collapse
 
miko65 profile image
Adrien

Thanks for the post. With Symfony 5.4 I had to declare the mock like this:

#services_test.yaml
AppBundle\Infra\Client\ApiClientInterface:
    class: Tests\Mocks\ApiClientMock
Enter fullscreen mode Exit fullscreen mode

Then you need to inject ApiClientInterface in your service's constructor in order to work.