Exemple #1
0
 public function testGetDisplayName()
 {
     $access = $this->getAccessMock();
     $this->prepareAccessForGetDisplayName($access);
     $backend = new UserLDAP($access, $this->getMock('\\OCP\\IConfig'));
     $this->prepareMockForUserExists($access);
     $access->connection->expects($this->any())->method('getConnectionResource')->will($this->returnCallback(function () {
         return true;
     }));
     //with displayName
     $result = $backend->getDisplayName('gunslinger');
     $this->assertEquals('Roland Deschain', $result);
     //empty displayname retrieved
     $result = $backend->getDisplayName('newyorker');
     $this->assertEquals(null, $result);
 }
 public function testGetDisplayName()
 {
     $access = $this->getAccessMock();
     $this->prepareAccessForGetDisplayName($access);
     $backend = new UserLDAP($access);
     $this->prepareMockForUserExists($access);
     //with displayName
     $result = $backend->getDisplayName('gunslinger');
     $this->assertEquals('Roland Deschain', $result);
     //empty displayname retrieved
     $result = $backend->getDisplayName('newyorker');
     $this->assertEquals(null, $result);
 }