public function testMethodSearchguidHasResultArrayEmptyIfTheSearchReturnedNoResults() { $result = $this->getMock('Horde_Kolab_Server_Result_Interface'); $result->expects($this->once())->method('asArray')->will($this->returnValue(array())); $this->structure->expects($this->once())->method('find')->with($this->isInstanceOf('Horde_Kolab_Server_Query_Element_Interface'), array('attributes' => 'guid'))->will($this->returnValue($result)); $search = new Horde_Kolab_Server_Search_Operation_Guid($this->structure); $criteria = $this->getMock('Horde_Kolab_Server_Query_Element_Interface'); $this->assertEquals(array(), $search->searchGuid($criteria)); }
/** * Restrict a search to groupOfNames. * * @param Horde_Kolab_Server_Query_Element $criteria The search criteria. * * @return array The GUID(s). * * @throws Horde_Kolab_Server_Exception */ public function searchRestrictGroups(Horde_Kolab_Server_Query_Element_Interface $criteria) { $criteria = new Horde_Kolab_Server_Query_Element_And(array(new Horde_Kolab_Server_Query_Element_Equals('objectClass', Horde_Kolab_Server_Object_Groupofnames::OBJECTCLASS_GROUPOFNAMES), $criteria)); return parent::searchGuid($criteria); }
/** * Return the GUIDs of all KolabInetOrgPersons. * * @return array The GUID(s). * * @throws Horde_Kolab_Server_Exception */ public function searchGuidForKolabUsers() { $criteria = new Horde_Kolab_Server_Query_Element_Equals('Objectclass', Horde_Kolab_Server_Object_Kolabinetorgperson::OBJECTCLASS_KOLABINETORGPERSON); return parent::searchGuid($criteria); }
/** * Identify the GUID for the objects found with the given common name. * * @param string $cn Search for objects with this common name. * * @return array The GUID(s). * * @throws Horde_Kolab_Server_Exception */ public function searchGuidForCn($cn) { $criteria = new Horde_Kolab_Server_Query_Element_Equals('cn', $cn); return parent::searchGuid($criteria); }
/** * Restrict a search to KolabInetOrgPersons. * * @param Horde_Kolab_Server_Query_Element $criteria The search criteria. * * @return array The GUID(s). * * @throws Horde_Kolab_Server_Exception */ public function searchRestrictKolab(Horde_Kolab_Server_Query_Element_Interface $criteria) { $criteria = new Horde_Kolab_Server_Query_Element_And(array(new Horde_Kolab_Server_Query_Element_Equals('objectClass', Horde_Kolab_Server_Object_Kolabinetorgperson::OBJECTCLASS_KOLABINETORGPERSON), $criteria)); return parent::searchGuid($criteria); }