8000 Added a tip about hardcoding URLS in functional tests · symfony/symfony-docs@220e124 · GitHub
[go: up one dir, main page]

Skip to content

Commit 220e124

Browse files
committed
Added a tip about hardcoding URLS in functional tests
1 parent a21fb26 commit 220e124

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

book/testing.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,12 @@ into your Symfony2 application::
320320
The ``request()`` method takes the HTTP method and a URL as arguments and
321321
returns a ``Crawler`` instance.
322322

323+
.. tip::
324+
325+
Hardcoding the request URLs is a best practice for functional tests. If the
326+
test generates URLS using the Symfony router, it won't detect any change
327+
made to the application URLs which may impact the end users.
328+
323329
Use the Crawler to find DOM elements in the Response. These elements can then
324330
be used to click on links and submit forms::
325331

0 commit comments

Comments
 (0)
0