0 1 20101128T225959Z '; $xml = new SimpleXMLElement($xml); $event = new Syncroton_Model_Event($xml->ApplicationData); $data = new kolab_sync_data_test; $result = $data->recurrence_to_kolab($event); $this->assertEquals('DAILY', $result['FREQ']); $this->assertEquals(1, $result['INTERVAL']); $this->assertEquals('20101128T225959Z', $result['UNTIL']->format("Ymd\THis\Z")); $xml = ' 1 1 8 '; $xml = new SimpleXMLElement($xml); $event = new Syncroton_Model_Event($xml->ApplicationData); $result = $data->recurrence_to_kolab($event, null); $this->assertEquals('WEEKLY', $result['FREQ']); $this->assertEquals(1, $result['INTERVAL']); $this->assertEquals('WE', $result['BYDAY']); } } /** * kolab_sync_data wrapper, so we can test preotected methods too */ class kolab_sync_data_test extends kolab_sync_data { function __construct() { } public function recurrence_to_kolab($data) { return parent::recurrence_to_kolab($data, null); } function toKolab(Syncroton_Model_IEntry $data, $folderId, $entry = null, $timezone = null) { } function getEntry(Syncroton_Model_SyncCollection $collection, $serverId, $as_array = false) { } }