Permalink
Browse files

feature #3839 document how to test actions (greg0ire)

This PR was merged into the 2.3 branch.

Discussion
----------

document how to test actions

It is not so easy to find, and maybe there is a way to set this on a more global level, but this solution does the job.

Commits
-------

e7f44ea document how to test actions
  • Loading branch information...
weaverryan committed May 12, 2014
2 parents d92c522 + e7f44ea commit 979533aa4430a0db4c421744023028192e02cb3d
Showing with 16 additions and 0 deletions.
  1. +16 −0 components/routing/hostname_pattern.rst
@@ -282,3 +282,19 @@ You can also set the host option on imported routes:
The host ``hello.example.com`` will be set on each route loaded from the new
routing resource.
Testing your Controllers
------------------------
You need to set the Host HTTP header on your request objects if you want to get
past url matching in your functional tests.
.. code-block:: php
$crawler = $client->request(
'GET',
'/homepage',
array(),
array(),
array('HTTP_HOST' => 'm.' . $client->getContainer()->getParameter('domain'))
);

0 comments on commit 979533a

Please sign in to comment.