Question from the Symfony 6 test

How to use URLs in a functional test in Symfony

Medium

According to the best pratices, what is the recommended way to use URLs in a functional test?

Author: Thomas CochardStatus: PublishedQuestion passed 875 times
Edit
4
Community Evaluations
developer avatar
David
08/02/2024
Il faut utiliser le générateur d'url, quoi d'autres ?
developer avatar
Auteur anonyme
12/02/2024
Il a mentionné que cette réponse est fausse XD
developer avatar
David
18/02/2024
justement, pourquoi ? XD
developer avatar
Thomas Cochard
01/03/2024
La documentation officielle de Symfony indique : Hardcoding the request URLs is a best practice for application tests. If the test generates URLs using the Symfony router, it won't detect any change made to the application URLs which may impact the end users. https://symfony.com/doc/current/testing.html