Skip to content

Commit 979533a

Browse files
committed
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
2 parents d92c522 + e7f44ea commit 979533a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

components/routing/hostname_pattern.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,3 +282,19 @@ You can also set the host option on imported routes:
282282
283283
The host ``hello.example.com`` will be set on each route loaded from the new
284284
routing resource.
285+
286+
Testing your Controllers
287+
------------------------
288+
289+
You need to set the Host HTTP header on your request objects if you want to get
290+
past url matching in your functional tests.
291+
292+
.. code-block:: php
293+
294+
$crawler = $client->request(
295+
'GET',
296+
'/homepage',
297+
array(),
298+
array(),
299+
array('HTTP_HOST' => 'm.' . $client->getContainer()->getParameter('domain'))
300+
);

0 commit comments

Comments
 (0)