"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/tine20/Calendar/Frontend/ActiveSyncTest.php" between
tine20-2020.08.3.tar.gz and tine20-2020.08.4.tar.gz

About: Tine 2.0 is a platform independent business software system which combines groupware and customer relationship management (CRM). Commercial support is available. Source code.

ActiveSyncTest.php  (tine20-2020.08.3):ActiveSyncTest.php  (tine20-2020.08.4)
<?php <?php
/** /**
* Tine 2.0 - http://www.tine20.org * Tine 2.0 - http://www.tine20.org
* *
* @package Calendar * @package Calendar
* @license http://www.gnu.org/licenses/agpl.html AGPL Version 3 * @license http://www.gnu.org/licenses/agpl.html AGPL Version 3
* @copyright Copyright (c) 2010-2018 Metaways Infosystems GmbH (http://www.me taways.de) * @copyright Copyright (c) 2010-2020 Metaways Infosystems GmbH (http://www.me taways.de)
* @author Cornelius Weiss <c.weiss@metaways.de> * @author Cornelius Weiss <c.weiss@metaways.de>
*/ */
/** /**
* Test class for Calendar_Frontend_ActiveSync * Test class for Calendar_Frontend_ActiveSync
* *
* @package Calendar * @package Calendar
*/ */
class Calendar_Frontend_ActiveSyncTest extends ActiveSync_Controller_ControllerT est class Calendar_Frontend_ActiveSyncTest extends ActiveSync_Controller_ControllerT est
{ {
skipping to change at line 467 skipping to change at line 467
$xml = str_replace(array( $xml = str_replace(array(
'lars@kneschke.de', 'lars@kneschke.de',
'unittest@tine20.org', 'unittest@tine20.org',
), $email, $xml); ), $email, $xml);
return $xml; return $xml;
} }
/** /**
* (non-PHPdoc) * @param null|Syncroton_Model_Folder $syncrotonFolder
* @see ActiveSync_TestCase::testCreateEntry() * @param null|string $xmlInput
* @param string $assertSubject
* @return array
*/ */
public function testCreateEntry($syncrotonFolder = null) public function testCreateEntry($syncrotonFolder = null, $xmlInput = null, $ assertSubject = 'Repeat')
{ {
if ($syncrotonFolder === null) { if ($syncrotonFolder === null) {
$syncrotonFolder = $this->testCreateFolder(); $syncrotonFolder = $this->testCreateFolder();
} }
$controller = Syncroton_Data_Factory::factory($this->_class, $this->_get Device(Syncroton_Model_Device::TYPE_WEBOS), Tinebase_DateTime::now()); $controller = Syncroton_Data_Factory::factory($this->_class, $this->_get Device(Syncroton_Model_Device::TYPE_WEBOS), Tinebase_DateTime::now());
$now = Tinebase_DateTime::now(); $now = Tinebase_DateTime::now();
$thisYear = $now->format('Y'); $thisYear = $now->format('Y');
$xmlString = preg_replace('/2012/', $thisYear, $this->_testXMLInput); $xmlString = $xmlInput ? $xmlInput : $this->_testXMLInput;
$xmlString = preg_replace('/2012/', $thisYear, $xmlString);
$xml = new SimpleXMLElement($xmlString); $xml = new SimpleXMLElement($xmlString);
$syncrotonEvent = new Syncroton_Model_Event($xml->Collections->Collectio n->Commands->Change[0]->ApplicationData); $syncrotonEvent = new Syncroton_Model_Event($xml->Collections->Collectio n->Commands->Change[0]->ApplicationData);
$serverId = $controller->createEntry($syncrotonFolder->serverId, $syncro tonEvent); $serverId = $controller->createEntry($syncrotonFolder->serverId, $syncro tonEvent);
$syncrotonEvent = $controller->getEntry(new Syncroton_Model_SyncCollecti on(array('collectionId' => $syncrotonFolder->serverId)), $serverId); $syncrotonEvent = $controller->getEntry(new Syncroton_Model_SyncCollecti on(array('collectionId' => $syncrotonFolder->serverId)), $serverId);
$this->assertEquals(0, $syncrotonEvent->allDayEvent, 'alldayEven t'); $this->assertEquals(0, $syncrotonEvent->allDayEvent, 'alldayEven t');
$this->assertEquals(2, $syncrotonEvent->busyStatus); $this->assertEquals(2, $syncrotonEvent->busyStatus);
$this->assertEquals('Repeat', $syncrotonEvent->subject); $this->assertEquals($assertSubject, $syncrotonEvent->subject);
$this->assertEquals(15, $syncrotonEvent->reminder); $this->assertEquals(15, $syncrotonEvent->reminder);
$this->assertEquals(2, $syncrotonEvent->sensitivity); $this->assertEquals(2, $syncrotonEvent->sensitivity);
$this->assertTrue($syncrotonEvent->endTime instanceof DateTime); $this->assertTrue($syncrotonEvent->endTime instanceof DateTime);
$this->assertTrue($syncrotonEvent->startTime instanceof DateTime); $this->assertTrue($syncrotonEvent->startTime instanceof DateTime);
$this->assertEquals($thisYear . '1123T160000Z', $syncrotonEvent->endTime ->format('Ymd\THis\Z')); $this->assertEquals($thisYear . '1123T160000Z', $syncrotonEvent->endTime ->format('Ymd\THis\Z'));
$this->assertEquals($thisYear . '1123T130000Z', $syncrotonEvent->startTi me->format('Ymd\THis\Z')); $this->assertEquals($thisYear . '1123T130000Z', $syncrotonEvent->startTi me->format('Ymd\THis\Z'));
$this->assertEquals(1, count($syncrotonEvent->attendees), 'event: ' . va r_export($syncrotonEvent->attendees, TRUE)); $this->assertEquals(1, count($syncrotonEvent->attendees), 'event: ' . va r_export($syncrotonEvent->attendees, TRUE));
$this->assertEquals(Tinebase_Core::getUser()->accountEmailAddress, $sync rotonEvent->attendees[0]->email, 'event: ' . var_export($syncrotonEvent, TRUE)); $this->assertEquals(Tinebase_Core::getUser()->accountEmailAddress, $sync rotonEvent->attendees[0]->email, 'event: ' . var_export($syncrotonEvent, TRUE));
//Body //Body
skipping to change at line 515 skipping to change at line 518
$this->assertTrue($syncrotonEvent->recurrence instanceof Syncroton_Model _EventRecurrence); $this->assertTrue($syncrotonEvent->recurrence instanceof Syncroton_Model _EventRecurrence);
$this->assertEquals(Syncroton_Model_EventRecurrence::TYPE_DAILY, $syncro tonEvent->recurrence->type); $this->assertEquals(Syncroton_Model_EventRecurrence::TYPE_DAILY, $syncro tonEvent->recurrence->type);
$this->assertEquals(1, $syncrotonEvent->recurrence->interval); $this->assertEquals(1, $syncrotonEvent->recurrence->interval);
$this->assertTrue($syncrotonEvent->recurrence->until instanceof DateTime ); $this->assertTrue($syncrotonEvent->recurrence->until instanceof DateTime );
$this->assertEquals($thisYear . '1128T225959Z', $syncrotonEvent->recurre nce->until->format('Ymd\THis\Z')); $this->assertEquals($thisYear . '1128T225959Z', $syncrotonEvent->recurre nce->until->format('Ymd\THis\Z'));
// Exceptions // Exceptions
$this->assertEquals(2, count($syncrotonEvent->exceptions)); $this->assertEquals(2, count($syncrotonEvent->exceptions));
$this->assertTrue($syncrotonEvent->exceptions[0] instanceof Syncroton_Mo del_EventException); $this->assertTrue($syncrotonEvent->exceptions[0] instanceof Syncroton_Mo del_EventException);
$this->assertFalse(isset($syncrotonEvent->exceptions[0]->deleted), 'exce ption deleted with value of 0 should not be set'); $this->assertFalse(isset($syncrotonEvent->exceptions[0]->deleted), 'exce ption deleted with value of 0 should not be set');
$this->assertEquals('Repeat mal anders', $syncrotonEvent->exceptions[0]- >subject); $this->assertEquals($assertSubject . ' mal anders', $syncrotonEvent->exc eptions[0]->subject);
$this->assertEquals($thisYear . '1125T130000Z', $syncrotonEvent->excepti ons[0]->exceptionStartTime->format('Ymd\THis\Z')); $this->assertEquals($thisYear . '1125T130000Z', $syncrotonEvent->excepti ons[0]->exceptionStartTime->format('Ymd\THis\Z'));
$this->assertEquals($thisYear . '1125T170000Z', $syncrotonEvent->excepti ons[0]->endTime->format('Ymd\THis\Z')); $this->assertEquals($thisYear . '1125T170000Z', $syncrotonEvent->excepti ons[0]->endTime->format('Ymd\THis\Z'));
$this->assertEquals($thisYear . '1125T140000Z', $syncrotonEvent->excepti ons[0]->startTime->format('Ymd\THis\Z')); $this->assertEquals($thisYear . '1125T140000Z', $syncrotonEvent->excepti ons[0]->startTime->format('Ymd\THis\Z'));
$this->assertEquals(1, $syncrotonEvent->exceptions[1]->deleted); $this->assertEquals(1, $syncrotonEvent->exceptions[1]->deleted);
$this->assertEquals($thisYear . '1124T130000Z', $syncrotonEvent->excepti ons[1]->exceptionStartTime->format('Ymd\THis\Z')); $this->assertEquals($thisYear . '1124T130000Z', $syncrotonEvent->excepti ons[1]->exceptionStartTime->format('Ymd\THis\Z'));
return array($serverId, $syncrotonEvent); return array($serverId, $syncrotonEvent);
} }
public function testCreateEntryWithEmojiSubject()
{
$subject = "\xF0\x9F\xA5\xB0";
$xmlString = str_replace('Repeat', $subject, $this->_testXMLInput);
$this->testCreateEntry(null, $xmlString, $subject);
}
public function testCreateEntryPalmPreV12($syncrotonFolder = null) public function testCreateEntryPalmPreV12($syncrotonFolder = null)
{ {
if ($syncrotonFolder === null) { if ($syncrotonFolder === null) {
$syncrotonFolder = $this->testCreateFolder(); $syncrotonFolder = $this->testCreateFolder();
} }
$controller = Syncroton_Data_Factory::factory($this->_class, $this->_get Device(Syncroton_Model_Device::TYPE_IPHONE), Tinebase_DateTime::now()); $controller = Syncroton_Data_Factory::factory($this->_class, $this->_get Device(Syncroton_Model_Device::TYPE_IPHONE), Tinebase_DateTime::now());
$xml = new SimpleXMLElement($this->_testXMLInput_palmPreV12); $xml = new SimpleXMLElement($this->_testXMLInput_palmPreV12);
$syncrotonEvent = new Syncroton_Model_Event($xml->Collections->Collectio n->Commands->Change[0]->ApplicationData); $syncrotonEvent = new Syncroton_Model_Event($xml->Collections->Collectio n->Commands->Change[0]->ApplicationData);
 End of changes. 7 change blocks. 
7 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)