Example #1
0
 /**
  * tests whether Group Backend behaves correctly when cache with uid and gid
  * is hit
  */
 public function testInGroupHitsUidGidCache()
 {
     $access = $this->getAccessMock();
     $this->enableGroups($access);
     $uid = 'someUser';
     $gid = 'someGroup';
     $cacheKey = 'inGroup' . $uid . ':' . $gid;
     $access->connection->expects($this->once())->method('isCached')->with($cacheKey)->will($this->returnValue(true));
     $access->connection->expects($this->once())->method('getFromCache')->with($cacheKey)->will($this->returnValue(true));
     $access->expects($this->never())->method('username2dn');
     $groupBackend = new GroupLDAP($access);
     $groupBackend->inGroup($uid, $gid);
 }