Skip to content

Commit 6277c23

Browse files
tvlooyweaverryan
authored andcommitted
how to switch to http authentication for your tests
1 parent 56e25eb commit 6277c23

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

cookbook/testing/http_authentication.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,21 @@ You can also override it on a per request basis::
1818
'PHP_AUTH_USER' => 'username',
1919
'PHP_AUTH_PW' => 'pa$$word',
2020
));
21+
22+
When your application is using a form_login with an entity provider, you can
23+
simplify your tests by allowing your test configuration to make use of HTTP
24+
authentication. This way you can use the above to authenticate and still use
25+
the entity provider::
26+
27+
.. configuration-block::
28+
29+
.. code-block:: yaml
30+
31+
# app/config/config_test.yml
32+
security:
33+
firewalls:
34+
secured_area:
35+
http_basic:
36+
37+
You do have to know the password for your users as this stored encrypted in
38+
the database. You can use fixtures to load test users into your database.

0 commit comments

Comments
 (0)