mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 08:14:03 +02:00
Fix authentication backend tests
This commit is contained in:
parent
f4a00d24e5
commit
6cc4f1b53a
@ -111,7 +111,7 @@ class BackendMock implements UserBackend
|
|||||||
public function authenticate(Credential $credentials)
|
public function authenticate(Credential $credentials)
|
||||||
{
|
{
|
||||||
if (!in_array($credentials, $this->allowedCredentials)) {
|
if (!in_array($credentials, $this->allowedCredentials)) {
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return self::getDummyUser();
|
return self::getDummyUser();
|
||||||
|
@ -211,14 +211,14 @@ class LdapUserBackendTest extends BaseTestCase
|
|||||||
$backend->authenticate(new Credential('jwoe', 'passjwoe'))
|
$backend->authenticate(new Credential('jwoe', 'passjwoe'))
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertFalse($backend->authenticate(new Credential('jwoe', 'passjwoe22')));
|
$this->assertNull($backend->authenticate(new Credential('jwoe', 'passjwoe22')));
|
||||||
|
|
||||||
$this->assertInstanceOf(
|
$this->assertInstanceOf(
|
||||||
'\Icinga\User',
|
'\Icinga\User',
|
||||||
$backend->authenticate(new Credential('rmiles', 'passrmiles'))
|
$backend->authenticate(new Credential('rmiles', 'passrmiles'))
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertFalse($backend->authenticate(new Credential('rmiles', 'passrmiles33')));
|
$this->assertNull($backend->authenticate(new Credential('rmiles', 'passrmiles33')));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user