Skip to content

Commit ea9574c

Browse files
committed
minor #6740 Add little comment indicating meaning of $firewall variable (ruslan-fidesio, WouterJ)
This PR was merged into the 2.7 branch. Discussion ---------- Add little comment indicating meaning of $firewall variable Finishes #5981 Commits ------- 2a702c3 Improve comment 2545203 If context is defined, it is used instead of the firewall
2 parents 812dbfd + 2a702c3 commit ea9574c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cookbook/testing/simulating_authentication.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ It could become an issue especially when ``form_login`` is used, since
99
it requires additional requests to fill in and submit the form.
1010

1111
One of the solutions is to configure your firewall to use ``http_basic`` in
12-
the test environment as explained in
13-
:doc:`/cookbook/testing/http_authentication`.
12+
the test environment as explained in :doc:`/cookbook/testing/http_authentication`.
1413
Another way would be to create a token yourself and store it in a session.
1514
While doing this, you have to make sure that an appropriate cookie is sent
1615
with a request. The following example demonstrates this technique::
@@ -45,7 +44,9 @@ with a request. The following example demonstrates this technique::
4544
{
4645
$session = $this->client->getContainer()->get('session');
4746

47+
// the firewall context (defaults to the firewall name)
4848
$firewall = 'secured_area';
49+
4950
$token = new UsernamePasswordToken('admin', null, $firewall, array('ROLE_ADMIN'));
5051
$session->set('_security_'.$firewall, serialize($token));
5152
$session->save();

0 commit comments

Comments
 (0)