Fix authentication backend tests

This commit is contained in:
Johannes Meyer 2014-01-29 15:57:51 +01:00
parent f4a00d24e5
commit 6cc4f1b53a
2 changed files with 3 additions and 3 deletions

View File

@ -111,7 +111,7 @@ class BackendMock implements UserBackend
public function authenticate(Credential $credentials)
{
if (!in_array($credentials, $this->allowedCredentials)) {
return false;
return;
}
return self::getDummyUser();

View File

@ -211,14 +211,14 @@ class LdapUserBackendTest extends BaseTestCase
$backend->authenticate(new Credential('jwoe', 'passjwoe'))
);
$this->assertFalse($backend->authenticate(new Credential('jwoe', 'passjwoe22')));
$this->assertNull($backend->authenticate(new Credential('jwoe', 'passjwoe22')));
$this->assertInstanceOf(
'\Icinga\User',
$backend->authenticate(new Credential('rmiles', 'passrmiles'))
);
$this->assertFalse($backend->authenticate(new Credential('rmiles', 'passrmiles33')));
$this->assertNull($backend->authenticate(new Credential('rmiles', 'passrmiles33')));
}
/**