コード例 #1
0
 public function testGetAttributesMinimal()
 {
     list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = $this->getTestInstances();
     $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc);
     $manager->setLdapAccess($access);
     $attributes = $manager->getAttributes(true);
     $this->assertTrue(in_array('dn', $attributes));
     $this->assertTrue(!in_array('jpegphoto', $attributes));
     $this->assertTrue(!in_array('thumbnailphoto', $attributes));
 }
コード例 #2
0
ファイル: manager.php プロジェクト: Kevin-ZK/vaneDisk
 public function testGetByUidNotExisting()
 {
     list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = $this->getTestInstances();
     $dn = 'cn=foo,dc=foobar,dc=bar';
     $uid = 'gone';
     $access->expects($this->never())->method('dn2username');
     $access->expects($this->exactly(1))->method('username2dn')->with($this->equalTo($uid))->will($this->returnValue(false));
     $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc);
     $manager->setLdapAccess($access);
     $user = $manager->get($uid);
     $this->assertNull($user);
 }