[Security] Added a test to the BasicAuthenticationListener.

This commit is contained in:
Jakub Zalas 2013-05-27 21:42:10 +01:00
parent 314f29a718
commit 307bc91e02
1 changed files with 14 additions and 0 deletions

View File

@ -195,4 +195,18 @@ class BasicAuthenticationListenerTest extends \PHPUnit_Framework_TestCase
$listener->handle($event);
}
/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage $providerKey must not be empty
*/
public function testItRequiresProviderKey()
{
new BasicAuthenticationListener(
$this->getMock('Symfony\Component\Security\Core\SecurityContextInterface'),
$this->getMock('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface'),
'',
$this->getMock('Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface')
);
}
}