Added more unit tests for LDAP user class

This commit is contained in:
Frederic Guillot
2016-07-02 18:23:47 -04:00
parent 43337d58c0
commit a8a8bfb0af
2 changed files with 64 additions and 4 deletions

View File

@@ -845,4 +845,64 @@ class LdapUserTest extends Base
$this->assertTrue($this->user->hasGroupUserFilter());
}
public function testHasGroupsConfigured()
{
$this->user
->expects($this->any())
->method('getGroupAdminDn')
->will($this->returnValue('something'));
$this->user
->expects($this->any())
->method('getGroupManagerDn')
->will($this->returnValue('something'));
$this->assertTrue($this->user->hasGroupsConfigured());
}
public function testHasGroupAdminDnConfigured()
{
$this->user
->expects($this->any())
->method('getGroupAdminDn')
->will($this->returnValue('something'));
$this->user
->expects($this->any())
->method('getGroupManagerDn')
->will($this->returnValue(''));
$this->assertTrue($this->user->hasGroupsConfigured());
}
public function testHasGroupManagerDnConfigured()
{
$this->user
->expects($this->any())
->method('getGroupAdminDn')
->will($this->returnValue(''));
$this->user
->expects($this->any())
->method('getGroupManagerDn')
->will($this->returnValue('something'));
$this->assertTrue($this->user->hasGroupsConfigured());
}
public function testHasGroupsNotConfigured()
{
$this->user
->expects($this->any())
->method('getGroupAdminDn')
->will($this->returnValue(''));
$this->user
->expects($this->any())
->method('getGroupManagerDn')
->will($this->returnValue(''));
$this->assertFalse($this->user->hasGroupsConfigured());
}
}