Copyright 2008-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Автор: Gunnar Wrobel (wrobel@pardus.de)
Наследование: extends Horde_Kolab_Server_Search_Operation_Base
Пример #1
0
 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));
 }
Пример #2
0
 /**
  * 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);
 }
Пример #3
0
 /**
  * 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);
 }
Пример #4
0
 /**
  * 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);
 }
Пример #5
0
 /**
  * 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);
 }