Skip to content

Commit

Permalink
minor #3592 Added a tip about hardcoding URLs in functional tests (ja…
Browse files Browse the repository at this point in the history
…viereguiluz)

This PR was merged into the 2.3 branch.

Discussion
----------

Added a tip about hardcoding URLs in functional tests

| Q             | A
| ------------- | ---
| Doc fix?      | no
| New docs?     | yes
| Applies to    | all
| Fixed tickets | -

Commits
-------

b284e88 Fixed a minor typo
220e124 Added a tip about hardcoding URLS in functional tests
  • Loading branch information
weaverryan committed Mar 8, 2014
2 parents 178984b + b284e88 commit 6d1378e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions book/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down

0 comments on commit 6d1378e

Please sign in to comment.