From 220e12455659d98ccea76be6022fa88e904d37b3 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 20 Feb 2014 08:54:54 +0100 Subject: [PATCH 1/2] Added a tip about hardcoding URLS in functional tests --- book/testing.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/book/testing.rst b/book/testing.rst index 1f0b5d608b4..a9fae38ec2b 100644 --- a/book/testing.rst +++ b/book/testing.rst @@ -320,6 +320,12 @@ into your Symfony2 application:: The ``request()`` method takes the HTTP method and a URL as arguments and returns a ``Crawler`` instance. +.. tip:: + + Hardcoding the request URLs is a best practice for functional 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. + Use the Crawler to find DOM elements in the Response. These elements can then be used to click on links and submit forms:: From b284e88d86182a160afe8c666fa178b00b130f65 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 20 Feb 2014 12:41:31 +0100 Subject: [PATCH 2/2] Fixed a minor typo --- book/testing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/testing.rst b/book/testing.rst index a9fae38ec2b..963b5cd463c 100644 --- a/book/testing.rst +++ b/book/testing.rst @@ -323,7 +323,7 @@ returns a ``Crawler`` instance. .. tip:: Hardcoding the request URLs is a best practice for functional tests. If the - test generates URLS using the Symfony router, it won't detect any change + test generates URLs using the Symfony router, it won't detect any change made to the application URLs which may impact the end users. Use the Crawler to find DOM elements in the Response. These elements can then