diff --git a/testing/http_authentication.rst b/testing/http_authentication.rst index 8d5d37970cf..8833878c424 100644 --- a/testing/http_authentication.rst +++ b/testing/http_authentication.rst @@ -113,10 +113,12 @@ needs:: { $session = $this->client->getContainer()->get('session'); - // the firewall context defaults to the firewall name + $firewallName = 'secure_area'; + // if you don't define multiple connected firewalls, the context defaults to the firewall name + // See https://symfony.com/doc/current/reference/configuration/security.html#firewall-context $firewallContext = 'secured_area'; - $token = new UsernamePasswordToken('admin', null, $firewallContext, array('ROLE_ADMIN')); + $token = new UsernamePasswordToken('admin', null, $firewallName, array('ROLE_ADMIN')); $session->set('_security_'.$firewallContext, serialize($token)); $session->save();