public function testGetAll() { $expected = array('user1@localhost', 'user2@localhost'); $entry = new Entry($this->entry); $this->assertEquals($expected, $entry->getAll('mail')); $this->assertEmpty($entry->getAll('not found')); $this->assertEmpty($entry->getAll('broken')); }
/** * Get user groupIds (DN) * * 1) If configured, use memberUid and posixGroup * 2) Otherwise, use memberOf * * @access protected * @param Entry $entry * @param string $username * @return string[] */ protected function getGroups(Entry $entry, $username) { $groupIds = array(); if (!empty($username) && $this->group !== null && $this->hasGroupUserFilter()) { $groups = $this->group->find(sprintf($this->getGroupUserFilter(), $username)); foreach ($groups as $group) { $groupIds[] = $group->getExternalId(); } } else { $groupIds = $entry->getAll($this->getAttributeGroup()); } return $groupIds; }