예제 #1
0
 /**
  * test getChanged entries
  */
 public function testGetChanged()
 {
     $controller = new ActiveSync_Controller_Contacts($this->objects['deviceIPhone'], new Tinebase_DateTime(null, null, 'de_DE'));
     Addressbook_Controller_Contact::getInstance()->update($this->objects['contact'], FALSE);
     Addressbook_Controller_Contact::getInstance()->update($this->objects['unSyncableContact'], FALSE);
     $entries = $controller->getChangedEntries('addressbook-root', Tinebase_DateTime::now()->subMinute(1));
     #var_dump($entries);
     $this->assertContains($this->objects['contact']->getId(), $entries);
     $this->assertNotContains($this->objects['unSyncableContact']->getId(), $entries);
 }
예제 #2
0
 /**
  * test search contacts
  * 
  */
 public function _testSearch()
 {
     $controller = new ActiveSync_Controller_Contacts($this->objects['devicePalm'], new Tinebase_DateTime(null, null, 'de_DE'));
     // search for non existing contact
     $xml = new SimpleXMLElement($this->_exampleXMLNotExisting);
     $existing = $controller->search('addressbook-root', $xml->Collections->Collection->Commands->Add->ApplicationData);
     $this->assertEquals(count($existing), 0);
     // search for existing contact
     $xml = new SimpleXMLElement($this->_exampleXMLExisting);
     $existing = $controller->search('addressbook-root', $xml->Collections->Collection->Commands->Add->ApplicationData);
     $this->assertEquals(count($existing), 1);
 }