[Symony 4.2][WebTestCase] Provide autowiring services and api controller args

I’m new on symfony functional test world and trying to test my first api controller with a lot of trouble…

I’m trying to test that end point : Controller

Problems : That controller use EntityManager, TokenInterface (not used, juste for example) and a string tokenValue.
I can provide entityManager interface with initialize it in static::$container, but can’t with TokenInterface and don’t know how to proceed for $tokenValue

Here’s my test : Test

And errors :

TokenInterfaceError

TokenValueError

Question : How to proceed to inject that required arguments from a functional test ?

Thank you in advance for your time 🙂

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *