diff options
| author | Horus3 | 2014-02-24 16:42:14 +0100 |
|---|---|---|
| committer | Horus3 | 2014-02-24 16:42:14 +0100 |
| commit | 06f945f27840b53e57795dadbc38e76f7e11ab1c (patch) | |
| tree | 689d5c7f4ffa15460c7e90f47c6a7dd59ce4e8bd /zend/tests/Zend/Gdata/Calendar | |
| download | random-06f945f27840b53e57795dadbc38e76f7e11ab1c.tar.gz | |
init
Diffstat (limited to 'zend/tests/Zend/Gdata/Calendar')
25 files changed, 2742 insertions, 0 deletions
diff --git a/zend/tests/Zend/Gdata/Calendar/AccessLevelTest.php b/zend/tests/Zend/Gdata/Calendar/AccessLevelTest.php new file mode 100644 index 0000000..44803fd --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/AccessLevelTest.php @@ -0,0 +1,124 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id $ + */ + +require_once 'Zend/Gdata/Calendar/Extension/AccessLevel.php'; +require_once 'Zend/Gdata/Calendar.php'; + +/** + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @group Zend_Gdata + * @group Zend_Gdata_Calendar + */ +class Zend_Gdata_Calendar_AccessLevelTest extends PHPUnit_Framework_TestCase +{ + + public function setUp() { + $this->accessLevelText = file_get_contents( + 'Zend/Gdata/Calendar/_files/AccessLevelElementSample1.xml', + true); + $this->accessLevel = new Zend_Gdata_Calendar_Extension_AccessLevel(); + } + + public function testEmptyAccessLevelShouldHaveNoExtensionElements() { + $this->assertTrue(is_array($this->accessLevel->extensionElements)); + $this->assertTrue(count($this->accessLevel->extensionElements) == 0); + } + + public function testEmptyAccessLevelShouldHaveNoExtensionAttributes() { + $this->assertTrue(is_array($this->accessLevel->extensionAttributes)); + $this->assertTrue(count($this->accessLevel->extensionAttributes) == 0); + } + + public function testSampleAccessLevelShouldHaveNoExtensionElements() { + $this->accessLevel->transferFromXML($this->accessLevelText); + $this->assertTrue(is_array($this->accessLevel->extensionElements)); + $this->assertTrue(count($this->accessLevel->extensionElements) == 0); + } + + public function testSampleAccessLevelShouldHaveNoExtensionAttributes() { + $this->accessLevel->transferFromXML($this->accessLevelText); + $this->assertTrue(is_array($this->accessLevel->extensionAttributes)); + $this->assertTrue(count($this->accessLevel->extensionAttributes) == 0); + } + + public function testNormalAccessLevelShouldHaveNoExtensionElements() { + $this->accessLevel->value = 'freebusy'; + $this->assertEquals($this->accessLevel->value, 'freebusy'); + $this->assertEquals(count($this->accessLevel->extensionElements), 0); + $newAccessLevel = new Zend_Gdata_Calendar_Extension_AccessLevel(); + $newAccessLevel->transferFromXML($this->accessLevel->saveXML()); + $this->assertEquals(count($newAccessLevel->extensionElements), 0); + $newAccessLevel->extensionElements = array( + new Zend_Gdata_App_Extension_Element('foo', 'atom', null, 'bar')); + $this->assertEquals(count($newAccessLevel->extensionElements), 1); + $this->assertEquals($newAccessLevel->value, 'freebusy'); + + /* try constructing using magic factory */ + $cal = new Zend_Gdata_Calendar(); + $newAccessLevel2 = $cal->newAccessLevel(); + $newAccessLevel2->transferFromXML($newAccessLevel->saveXML()); + $this->assertEquals(count($newAccessLevel2->extensionElements), 1); + $this->assertEquals($newAccessLevel2->value, 'freebusy'); + } + + public function testEmptyAccessLevelToAndFromStringShouldMatch() { + $accessLevelXml = $this->accessLevel->saveXML(); + $newAccessLevel = new Zend_Gdata_Calendar_Extension_AccessLevel(); + $newAccessLevel->transferFromXML($accessLevelXml); + $newAccessLevelXml = $newAccessLevel->saveXML(); + $this->assertTrue($accessLevelXml == $newAccessLevelXml); + } + + public function testAccessLevelWithValueToAndFromStringShouldMatch() { + $this->accessLevel->value = 'freebusy'; + $accessLevelXml = $this->accessLevel->saveXML(); + $newAccessLevel = new Zend_Gdata_Calendar_Extension_AccessLevel(); + $newAccessLevel->transferFromXML($accessLevelXml); + $newAccessLevelXml = $newAccessLevel->saveXML(); + $this->assertTrue($accessLevelXml == $newAccessLevelXml); + $this->assertEquals('freebusy', $newAccessLevel->value); + } + + public function testExtensionAttributes() { + $extensionAttributes = $this->accessLevel->extensionAttributes; + $extensionAttributes['foo1'] = array('name'=>'foo1', 'value'=>'bar'); + $extensionAttributes['foo2'] = array('name'=>'foo2', 'value'=>'rab'); + $this->accessLevel->extensionAttributes = $extensionAttributes; + $this->assertEquals('bar', $this->accessLevel->extensionAttributes['foo1']['value']); + $this->assertEquals('rab', $this->accessLevel->extensionAttributes['foo2']['value']); + $accessLevelXml = $this->accessLevel->saveXML(); + $newAccessLevel = new Zend_Gdata_Calendar_Extension_AccessLevel(); + $newAccessLevel->transferFromXML($accessLevelXml); + $this->assertEquals('bar', $newAccessLevel->extensionAttributes['foo1']['value']); + $this->assertEquals('rab', $newAccessLevel->extensionAttributes['foo2']['value']); + } + + public function testConvertFullAccessLevelToAndFromString() { + $this->accessLevel->transferFromXML($this->accessLevelText); + $this->assertEquals($this->accessLevel->value, 'owner'); + } + +} diff --git a/zend/tests/Zend/Gdata/Calendar/ColorTest.php b/zend/tests/Zend/Gdata/Calendar/ColorTest.php new file mode 100644 index 0000000..84695e4 --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/ColorTest.php @@ -0,0 +1,124 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id $ + */ + +require_once 'Zend/Gdata/Calendar/Extension/Color.php'; +require_once 'Zend/Gdata/Calendar.php'; + +/** + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @group Zend_Gdata + * @group Zend_Gdata_Calendar + */ +class Zend_Gdata_Calendar_ColorTest extends PHPUnit_Framework_TestCase +{ + + public function setUp() { + $this->colorText = file_get_contents( + 'Zend/Gdata/Calendar/_files/ColorElementSample1.xml', + true); + $this->color = new Zend_Gdata_Calendar_Extension_Color(); + } + + public function testEmptyColorShouldHaveNoExtensionElements() { + $this->assertTrue(is_array($this->color->extensionElements)); + $this->assertTrue(count($this->color->extensionElements) == 0); + } + + public function testEmptyColorShouldHaveNoExtensionAttributes() { + $this->assertTrue(is_array($this->color->extensionAttributes)); + $this->assertTrue(count($this->color->extensionAttributes) == 0); + } + + public function testSampleColorShouldHaveNoExtensionElements() { + $this->color->transferFromXML($this->colorText); + $this->assertTrue(is_array($this->color->extensionElements)); + $this->assertTrue(count($this->color->extensionElements) == 0); + } + + public function testSampleColorShouldHaveNoExtensionAttributes() { + $this->color->transferFromXML($this->colorText); + $this->assertTrue(is_array($this->color->extensionAttributes)); + $this->assertTrue(count($this->color->extensionAttributes) == 0); + } + + public function testNormalColorShouldHaveNoExtensionElements() { + $this->color->value = '#abcdef'; + $this->assertEquals($this->color->value, '#abcdef'); + $this->assertEquals(count($this->color->extensionElements), 0); + $newColor = new Zend_Gdata_Calendar_Extension_Color(); + $newColor->transferFromXML($this->color->saveXML()); + $this->assertEquals(count($newColor->extensionElements), 0); + $newColor->extensionElements = array( + new Zend_Gdata_App_Extension_Element('foo', 'atom', null, 'bar')); + $this->assertEquals(count($newColor->extensionElements), 1); + $this->assertEquals($newColor->value, '#abcdef'); + + /* try constructing using magic factory */ + $cal = new Zend_Gdata_Calendar(); + $newColor2 = $cal->newColor(); + $newColor2->transferFromXML($newColor->saveXML()); + $this->assertEquals(count($newColor2->extensionElements), 1); + $this->assertEquals($newColor2->value, '#abcdef'); + } + + public function testEmptyColorToAndFromStringShouldMatch() { + $colorXml = $this->color->saveXML(); + $newColor = new Zend_Gdata_Calendar_Extension_Color(); + $newColor->transferFromXML($colorXml); + $newColorXml = $newColor->saveXML(); + $this->assertTrue($colorXml == $newColorXml); + } + + public function testColorWithValueToAndFromStringShouldMatch() { + $this->color->value = '#abcdef'; + $colorXml = $this->color->saveXML(); + $newColor = new Zend_Gdata_Calendar_Extension_Color(); + $newColor->transferFromXML($colorXml); + $newColorXml = $newColor->saveXML(); + $this->assertTrue($colorXml == $newColorXml); + $this->assertEquals('#abcdef', $newColor->value); + } + + public function testExtensionAttributes() { + $extensionAttributes = $this->color->extensionAttributes; + $extensionAttributes['foo1'] = array('name'=>'foo1', 'value'=>'bar'); + $extensionAttributes['foo2'] = array('name'=>'foo2', 'value'=>'rab'); + $this->color->extensionAttributes = $extensionAttributes; + $this->assertEquals('bar', $this->color->extensionAttributes['foo1']['value']); + $this->assertEquals('rab', $this->color->extensionAttributes['foo2']['value']); + $colorXml = $this->color->saveXML(); + $newColor = new Zend_Gdata_Calendar_Extension_Color(); + $newColor->transferFromXML($colorXml); + $this->assertEquals('bar', $newColor->extensionAttributes['foo1']['value']); + $this->assertEquals('rab', $newColor->extensionAttributes['foo2']['value']); + } + + public function testConvertFullColorToAndFromString() { + $this->color->transferFromXML($this->colorText); + $this->assertEquals($this->color->value, '#5A6986'); + } + +} diff --git a/zend/tests/Zend/Gdata/Calendar/EventEntryTest.php b/zend/tests/Zend/Gdata/Calendar/EventEntryTest.php new file mode 100644 index 0000000..7d6e0c9 --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/EventEntryTest.php @@ -0,0 +1,138 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @feed Zend + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id $ + */ + +require_once 'Zend/Gdata/Calendar/EventEntry.php'; +require_once 'Zend/Gdata/Calendar.php'; + +/** + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @group Zend_Gdata + * @group Zend_Gdata_Calendar + */ +class Zend_Gdata_Calendar_EventEntryTest extends PHPUnit_Framework_TestCase +{ + + public function setUp() { + $this->entryText = file_get_contents( + 'Zend/Gdata/Calendar/_files/EventEntrySample1.xml', + true); + $this->entry = new Zend_Gdata_Calendar_EventEntry(); + } + + public function testSetters() { + $entry = new Zend_Gdata_Calendar_EventEntry(); + $who = new Zend_Gdata_Extension_Who(); + $who->setValueString("John Doe"); + $who->setEmail("john@doe.com"); + $entry->setWho($who); + $whoRetrieved = $entry->getWho(); + $this->assertEquals("john@doe.com", $whoRetrieved->getEmail()); + $this->assertEquals("John Doe", $whoRetrieved->getValueString()); + } + + public function testEmptyEntryShouldHaveNoExtensionElements() { + $this->assertTrue(is_array($this->entry->extensionElements)); + $this->assertTrue(count($this->entry->extensionElements) == 0); + } + + public function testEmptyEntryShouldHaveNoExtensionAttributes() { + $this->assertTrue(is_array($this->entry->extensionAttributes)); + $this->assertTrue(count($this->entry->extensionAttributes) == 0); + } + + public function testSampleEntryShouldHaveNoExtensionElements() { + $this->entry->transferFromXML($this->entryText); + $this->assertTrue(is_array($this->entry->extensionElements)); + $this->assertTrue(count($this->entry->extensionElements) == 0); + } + + public function testSampleEntryShouldHaveNoExtensionAttributes() { + $this->entry->transferFromXML($this->entryText); + $this->assertTrue(is_array($this->entry->extensionAttributes)); + $this->assertTrue(count($this->entry->extensionAttributes) == 0); + } + + public function testEmptyEventEntryToAndFromStringShouldMatch() { + $entryXml = $this->entry->saveXML(); + $newEventEntry = new Zend_Gdata_Calendar_EventEntry(); + $newEventEntry->transferFromXML($entryXml); + $newEventEntryXml = $newEventEntry->saveXML(); + $this->assertTrue($entryXml == $newEventEntryXml); + } + + public function testConvertEventEntryToAndFromString() { + $this->entry->transferFromXML($this->entryText); + $entryXml = $this->entry->saveXML(); + $newEventEntry = new Zend_Gdata_Calendar_EventEntry(); + $newEventEntry->transferFromXML($entryXml); + $newEventEntryXml = $newEventEntry->saveXML(); + $this->assertEquals($entryXml, $newEventEntryXml); + $this->assertEquals('http://www.google.com/calendar/feeds/default/private/full/s0dtsvq4pe15ku09jideg67fv4_20070509T193000Z', + $newEventEntry->id->text); + $this->assertEquals('Mantek', + $newEventEntry->extendedProperty[0]->value); + $this->assertEquals('s0dtsvq4pe15ku09jideg67fv4', + $newEventEntry->originalEvent->id); + $this->assertEquals('s0dtsvq4pe15ku09jideg67fv4', + $newEventEntry->originalEvent->id); + $this->assertEquals('http://www.google.com/calendar/feeds/default/private/full/s0dtsvq4pe15ku09jideg67fv4_20070509T193000Z/comments', + $newEventEntry->comments->feedLink->href); + } + +/* + public function testEventEntryWithTextAndTypeToAndFromStringShouldMatch() { + $this->feed->text = '<img src="http://www.example.com/image.jpg"/>'; + $this->feed->type = 'xhtml'; + $feedXml = $this->feed->saveXML(); + $newEventEntry = new Zend_Gdata_App_EventEntry(); + $newEventEntry->transferFromXML($feedXml); + $newEventEntryXml = $newEventEntry->saveXML(); + $this->assertEquals($newEventEntryXml, $feedXml); + $this->assertEquals('<img src="http://www.example.com/image.jpg"/>', $newEventEntry->text); + $this->assertEquals('xhtml', $newEventEntry->type); + } + + public function testEventEntryWithSrcAndTypeToAndFromStringShouldMatch() { + $this->feed->src = 'http://www.example.com/image.png'; + $this->feed->type = 'image/png'; + $feedXml = $this->feed->saveXML(); + $newEventEntry = new Zend_Gdata_App_EventEntry(); + $newEventEntry->transferFromXML($feedXml); + $newEventEntryXml = $newEventEntry->saveXML(); + $this->assertEquals($newEventEntryXml, $feedXml); + $this->assertEquals('http://www.example.com/image.png', $newEventEntry->src); + $this->assertEquals('image/png', $newEventEntry->type); + } + + public function testConvertEventEntryWithSrcAndTypeToAndFromString() { + $this->feed->transferFromXML($this->feedText); + $this->assertEquals('http://www.example.com/image.png', $this->feed->src); + $this->assertEquals('image/png', $this->feed->type); + } +*/ + +} diff --git a/zend/tests/Zend/Gdata/Calendar/EventQueryExceptionTest.php b/zend/tests/Zend/Gdata/Calendar/EventQueryExceptionTest.php new file mode 100644 index 0000000..ad78f17 --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/EventQueryExceptionTest.php @@ -0,0 +1,68 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id $ + */ + +require_once 'Zend/Gdata/Calendar.php'; +require_once 'Zend/Gdata/Calendar/EventQuery.php'; +require_once 'Zend/Http/Client.php'; + +/** + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @group Zend_Gdata + * @group Zend_Gdata_Calendar + */ +class Zend_Gdata_Calendar_EventQueryExceptionTest extends PHPUnit_Framework_TestCase +{ + + const GOOGLE_DEVELOPER_CALENDAR = 'developer-calendar@google.com'; + + public function setUp() + { + $this->query = new Zend_Gdata_Calendar_EventQuery(); + } + + /** + * @expectedException Zend_Gdata_App_Exception + */ + public function testSingleEventsThrowsExceptionOnSetInvalidValue() + { + $this->query->resetParameters(); + $singleEvents = 'puppy'; + $this->query->setUser(self::GOOGLE_DEVELOPER_CALENDAR); + $this->query->setSingleEvents($singleEvents); + } + + /** + * @expectedException Zend_Gdata_App_Exception + */ + public function testFutureEventsThrowsExceptionOnSetInvalidValue() + { + $this->query->resetParameters(); + $futureEvents = 'puppy'; + $this->query->setUser(self::GOOGLE_DEVELOPER_CALENDAR); + $this->query->setFutureEvents($futureEvents); + } + +} diff --git a/zend/tests/Zend/Gdata/Calendar/EventQueryTest.php b/zend/tests/Zend/Gdata/Calendar/EventQueryTest.php new file mode 100644 index 0000000..7e4e834 --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/EventQueryTest.php @@ -0,0 +1,270 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id $ + */ + +require_once 'Zend/Gdata/Calendar.php'; +require_once 'Zend/Gdata/Calendar/EventQuery.php'; +require_once 'Zend/Http/Client.php'; + +/** + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @group Zend_Gdata + * @group Zend_Gdata_Calendar + */ +class Zend_Gdata_Calendar_EventQueryTest extends PHPUnit_Framework_TestCase +{ + + const GOOGLE_DEVELOPER_CALENDAR = 'developer-calendar@google.com'; + const ZEND_CONFERENCE_EVENT = 'bn2h4o4mc3a03ci4t48j3m56pg'; + const ZEND_CONFERENCE_EVENT_COMMENT = 'i9q87onko1uphfs7i21elnnb4g'; + const SAMPLE_RFC3339 = "2007-06-05T18:38:00"; + public function setUp() + { + $this->query = new Zend_Gdata_Calendar_EventQuery(); + } + + public function testDefaultBaseUrlForQuery() + { + $queryUrl = $this->query->getQueryUrl(); + $this->assertEquals('https://www.google.com/calendar/feeds/default/public/full', + $queryUrl); + } + + public function testAlternateBaseUrlForQuery() + { + $this->query = new Zend_Gdata_Calendar_EventQuery('http://www.foo.com'); + $queryUrl = $this->query->getQueryUrl(); + // the URL passed in the constructor has the user, visibility + // projection appended for the return value of $query->getQueryUrl() + $this->assertEquals('http://www.foo.com/default/public/full', $queryUrl); + } + + public function testUpdatedMinMaxParam() + { + $updatedMin = '2006-09-20'; + $updatedMax = '2006-11-05'; + $this->query->resetParameters(); + $this->query->setUser(self::GOOGLE_DEVELOPER_CALENDAR); + $this->query->setUpdatedMin($updatedMin); + $this->query->setUpdatedMax($updatedMax); + $this->assertTrue($this->query->updatedMin != null); + $this->assertTrue($this->query->updatedMax != null); + $this->assertTrue($this->query->user != null); + $this->assertEquals(Zend_Gdata_App_Util::formatTimestamp($updatedMin), $this->query->getUpdatedMin()); + $this->assertEquals(Zend_Gdata_App_Util::formatTimestamp($updatedMax), $this->query->getUpdatedMax()); + $this->assertEquals(self::GOOGLE_DEVELOPER_CALENDAR, $this->query->getUser()); + + $this->query->updatedMin = null; + $this->assertFalse($this->query->updatedMin != null); + $this->query->updatedMax = null; + $this->assertFalse($this->query->updatedMax != null); + $this->query->user = null; + $this->assertFalse($this->query->user != null); + } + + public function testStartMinMaxParam() + { + $this->query->resetParameters(); + $startMin = '2006-10-30'; + $startMax = '2006-11-01'; + $this->query->setUser(self::GOOGLE_DEVELOPER_CALENDAR); + $this->query->setStartMin($startMin); + $this->query->setStartMax($startMax); + $this->assertTrue($this->query->startMin != null); + $this->assertTrue($this->query->startMax != null); + $this->assertEquals(Zend_Gdata_App_Util::formatTimestamp($startMin), $this->query->getStartMin()); + $this->assertEquals(Zend_Gdata_App_Util::formatTimestamp($startMax), $this->query->getStartMax()); + + $this->query->startMin = null; + $this->assertFalse($this->query->startMin != null); + $this->query->startMax = null; + $this->assertFalse($this->query->startMax != null); + $this->query->user = null; + $this->assertFalse($this->query->user != null); + } + + public function testVisibilityParam() + { + $this->query->resetParameters(); + $visibility = 'private'; + $this->query->setUser(self::GOOGLE_DEVELOPER_CALENDAR); + $this->query->setVisibility($visibility); + $this->assertTrue($this->query->visibility != null); + $this->assertEquals($visibility, $this->query->getVisibility()); + $this->query->visibility = null; + $this->assertFalse($this->query->visibility != null); + } + + public function testProjectionParam() + { + $this->query->resetParameters(); + $projection = 'composite'; + $this->query->setUser(self::GOOGLE_DEVELOPER_CALENDAR); + $this->query->setProjection($projection); + $this->assertTrue($this->query->projection != null); + $this->assertEquals($projection, $this->query->getProjection()); + $this->query->projection = null; + $this->assertFalse($this->query->projection != null); + } + + public function testOrderbyParam() + { + $this->query->resetParameters(); + $orderby = 'starttime'; + $this->query->setUser(self::GOOGLE_DEVELOPER_CALENDAR); + $this->query->setOrderby($orderby); + $this->assertTrue($this->query->orderby != null); + $this->assertEquals($orderby, $this->query->getOrderby()); + $this->query->orderby = null; + $this->assertFalse($this->query->orderby != null); + } + + public function testEventParam() + { + $this->query->resetParameters(); + $this->query->setUser(self::GOOGLE_DEVELOPER_CALENDAR); + $this->query->setEvent(self::ZEND_CONFERENCE_EVENT); + $this->assertTrue($this->query->event != null); + $this->assertEquals(self::ZEND_CONFERENCE_EVENT, $this->query->getEvent()); + $this->query->event = null; + $this->assertFalse($this->query->event != null); + } + + public function testCommentsParam() + { + $this->query->resetParameters(); + $comment = 'we need to reschedule'; + $this->query->setComments($comment); + $this->assertTrue($this->query->comments != null); + $this->assertEquals($comment, $this->query->getComments()); + $this->query->comments = null; + $this->assertFalse(isset($this->query->comments)); + } + + public function testSortOrder() + { + $this->query->resetParameters(); + $sortOrder = 'ascending'; + $this->query->setUser(self::GOOGLE_DEVELOPER_CALENDAR); + $this->query->setSortOrder($sortOrder); + $this->assertTrue($this->query->sortOrder != null); + $this->assertEquals($sortOrder, $this->query->getSortOrder()); + $this->query->sortOrder = null; + $this->assertFalse($this->query->sortOrder != null); + } + + public function testRecurrenceExpansionStart() + { + $this->query->resetParameters(); + $res = self::SAMPLE_RFC3339; + $this->query->setUser(self::GOOGLE_DEVELOPER_CALENDAR); + $this->query->setRecurrenceExpansionStart($res); + $this->assertTrue($this->query->recurrenceExpansionStart != null); + $this->assertEquals($res, $this->query->getRecurrenceExpansionStart()); + $this->query->recurrenceExpansionStart = null; + $this->assertFalse($this->query->recurrenceExpansionStart != null); + } + + public function testRecurrenceExpansionEnd() + { + $this->query->resetParameters(); + $ree = self::SAMPLE_RFC3339; + $this->query->setUser(self::GOOGLE_DEVELOPER_CALENDAR); + $this->query->setRecurrenceExpansionEnd($ree); + $this->assertTrue($this->query->recurrenceExpansionEnd != null); + $this->assertEquals($ree, $this->query->getRecurrenceExpansionEnd()); + $this->query->recurrenceExpansionEnd = null; + $this->assertFalse($this->query->recurrenceExpansionEnd != null); + } + + public function testSingleEvents() + { + $this->query->resetParameters(); + // Test string handling + $singleEvents = 'true'; + $this->query->setUser(self::GOOGLE_DEVELOPER_CALENDAR); + $this->query->setSingleEvents($singleEvents); + $this->assertTrue($this->query->singleEvents === true); + // Test bool handling + $singleEvents = false; + $this->query->setUser(self::GOOGLE_DEVELOPER_CALENDAR); + $this->query->setSingleEvents($singleEvents); + $this->assertTrue($this->query->singleEvents === false); + // Test unsetting + $this->assertEquals($singleEvents, $this->query->getSingleEvents()); + $this->query->setSingleEvents(null); + $this->assertFalse($this->query->singleEvents != null); + } + + public function testFutureEvents() + { + $this->query->resetParameters(); + // Test string handling + $singleEvents = 'true'; + $this->query->setUser(self::GOOGLE_DEVELOPER_CALENDAR); + $this->query->setFutureEvents($singleEvents); + $this->assertTrue($this->query->futureEvents === true); + // Test bool handling + $singleEvents = false; + $this->query->setUser(self::GOOGLE_DEVELOPER_CALENDAR); + $this->query->setFutureEvents($singleEvents); + $this->assertTrue($this->query->futureEvents === false); + // Test unsetting + $this->query->futureEvents = null; + $this->assertFalse($this->query->futureEvents != null); + + } + + public function testCustomQueryURIGeneration() + { + $this->query->resetParameters(); + $this->query->setUser(self::GOOGLE_DEVELOPER_CALENDAR); + $this->query->setVisibility("private"); + $this->query->setProjection("composite"); + $this->query->setEvent(self::ZEND_CONFERENCE_EVENT); + $this->query->setComments(self::ZEND_CONFERENCE_EVENT_COMMENT); + $this->assertEquals("https://www.google.com/calendar/feeds/developer-calendar@google.com/private/composite/" . + self::ZEND_CONFERENCE_EVENT . "/comments/" . self::ZEND_CONFERENCE_EVENT_COMMENT, + $this->query->getQueryUrl()); + } + + public function testDefaultQueryURIGeneration() + { + $this->query->resetParameters(); + $this->assertEquals("https://www.google.com/calendar/feeds/default/public/full", + $this->query->getQueryUrl()); + } + + public function testCanNullifyParameters() + { + $testURI = "http://www.google.com/calendar/feeds/foo%40group.calendar.google.com/private/full"; + $this->query = new Zend_Gdata_Calendar_EventQuery($testURI); + $this->query->setUser(null); + $this->query->setVisibility(null); + $this->query->setProjection(null); + $result = $this->query->getQueryUrl(); + $this->assertEquals($testURI, $result); + } +} diff --git a/zend/tests/Zend/Gdata/Calendar/HiddenTest.php b/zend/tests/Zend/Gdata/Calendar/HiddenTest.php new file mode 100644 index 0000000..a2a5592 --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/HiddenTest.php @@ -0,0 +1,124 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id $ + */ + +require_once 'Zend/Gdata/Calendar/Extension/Hidden.php'; +require_once 'Zend/Gdata/Calendar.php'; + +/** + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @group Zend_Gdata + * @group Zend_Gdata_Calendar + */ +class Zend_Gdata_Calendar_HiddenTest extends PHPUnit_Framework_TestCase +{ + + public function setUp() { + $this->hiddenText = file_get_contents( + 'Zend/Gdata/Calendar/_files/HiddenElementSample1.xml', + true); + $this->hidden = new Zend_Gdata_Calendar_Extension_Hidden(); + } + + public function testEmptyHiddenShouldHaveNoExtensionElements() { + $this->assertTrue(is_array($this->hidden->extensionElements)); + $this->assertTrue(count($this->hidden->extensionElements) == 0); + } + + public function testEmptyHiddenShouldHaveNoExtensionAttributes() { + $this->assertTrue(is_array($this->hidden->extensionAttributes)); + $this->assertTrue(count($this->hidden->extensionAttributes) == 0); + } + + public function testSampleHiddenShouldHaveNoExtensionElements() { + $this->hidden->transferFromXML($this->hiddenText); + $this->assertTrue(is_array($this->hidden->extensionElements)); + $this->assertTrue(count($this->hidden->extensionElements) == 0); + } + + public function testSampleHiddenShouldHaveNoExtensionAttributes() { + $this->hidden->transferFromXML($this->hiddenText); + $this->assertTrue(is_array($this->hidden->extensionAttributes)); + $this->assertTrue(count($this->hidden->extensionAttributes) == 0); + } + + public function testNormalHiddenShouldHaveNoExtensionElements() { + $this->hidden->value = true; + $this->assertEquals($this->hidden->value, true); + $this->assertEquals(count($this->hidden->extensionElements), 0); + $newHidden = new Zend_Gdata_Calendar_Extension_Hidden(); + $newHidden->transferFromXML($this->hidden->saveXML()); + $this->assertEquals(count($newHidden->extensionElements), 0); + $newHidden->extensionElements = array( + new Zend_Gdata_App_Extension_Element('foo', 'atom', null, 'bar')); + $this->assertEquals(count($newHidden->extensionElements), 1); + $this->assertEquals($newHidden->value, true); + + /* try constructing using magic factory */ + $cal = new Zend_Gdata_Calendar(); + $newHidden2 = $cal->newHidden(); + $newHidden2->transferFromXML($newHidden->saveXML()); + $this->assertEquals(count($newHidden2->extensionElements), 1); + $this->assertEquals($newHidden2->value, true); + } + + public function testEmptyHiddenToAndFromStringShouldMatch() { + $hiddenXml = $this->hidden->saveXML(); + $newHidden = new Zend_Gdata_Calendar_Extension_Hidden(); + $newHidden->transferFromXML($hiddenXml); + $newHiddenXml = $newHidden->saveXML(); + $this->assertTrue($hiddenXml == $newHiddenXml); + } + + public function testHiddenWithValueToAndFromStringShouldMatch() { + $this->hidden->value = true; + $hiddenXml = $this->hidden->saveXML(); + $newHidden = new Zend_Gdata_Calendar_Extension_Hidden(); + $newHidden->transferFromXML($hiddenXml); + $newHiddenXml = $newHidden->saveXML(); + $this->assertTrue($hiddenXml == $newHiddenXml); + $this->assertEquals(true, $newHidden->value); + } + + public function testExtensionAttributes() { + $extensionAttributes = $this->hidden->extensionAttributes; + $extensionAttributes['foo1'] = array('name'=>'foo1', 'value'=>'bar'); + $extensionAttributes['foo2'] = array('name'=>'foo2', 'value'=>'rab'); + $this->hidden->extensionAttributes = $extensionAttributes; + $this->assertEquals('bar', $this->hidden->extensionAttributes['foo1']['value']); + $this->assertEquals('rab', $this->hidden->extensionAttributes['foo2']['value']); + $hiddenXml = $this->hidden->saveXML(); + $newHidden = new Zend_Gdata_Calendar_Extension_Hidden(); + $newHidden->transferFromXML($hiddenXml); + $this->assertEquals('bar', $newHidden->extensionAttributes['foo1']['value']); + $this->assertEquals('rab', $newHidden->extensionAttributes['foo2']['value']); + } + + public function testConvertFullHiddenToAndFromString() { + $this->hidden->transferFromXML($this->hiddenText); + $this->assertEquals($this->hidden->value, false); + } + +} diff --git a/zend/tests/Zend/Gdata/Calendar/LinkTest.php b/zend/tests/Zend/Gdata/Calendar/LinkTest.php new file mode 100644 index 0000000..cd171ce --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/LinkTest.php @@ -0,0 +1,165 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id $ + */ + +require_once 'Zend/Gdata/Calendar/Extension/Link.php'; +require_once 'Zend/Gdata/Calendar/Extension/WebContent.php'; +require_once 'Zend/Gdata/Calendar.php'; + +/** + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @group Zend_Gdata + * @group Zend_Gdata_Calendar + */ +class Zend_Gdata_Calendar_LinkTest extends PHPUnit_Framework_TestCase +{ + + public function setUp() { + $this->linkText = file_get_contents( + 'Zend/Gdata/Calendar/_files/LinkElementSample1.xml', + true); + $this->link = new Zend_Gdata_Calendar_Extension_Link(); + } + + public function testEmptyLinkShouldHaveNoExtensionElements() { + $this->assertTrue(is_array($this->link->extensionElements)); + $this->assertTrue(count($this->link->extensionElements) == 0); + } + + public function testEmptyLinkShouldHaveNoExtensionAttributes() { + $this->assertTrue(is_array($this->link->extensionAttributes)); + $this->assertTrue(count($this->link->extensionAttributes) == 0); + } + + public function testSampleLinkShouldHaveNoExtensionElements() { + $this->link->transferFromXML($this->linkText); + $this->assertTrue(is_array($this->link->extensionElements)); + $this->assertTrue(count($this->link->extensionElements) == 0); + } + + public function testSampleLinkShouldHaveNoExtensionAttributes() { + $this->link->transferFromXML($this->linkText); + $this->assertTrue(is_array($this->link->extensionAttributes)); + $this->assertTrue(count($this->link->extensionAttributes) == 0); + } + + public function testNormalLinkShouldHaveNoExtensionElements() { + $this->link->rel = "http://nowhere.invalid/"; + $this->link->title = "Somewhere"; + $this->link->href = "http://somewhere.invalid/"; + $this->link->type = "text/plain"; + $this->link->webContent = new Zend_Gdata_Calendar_Extension_WebContent("a", "1", "2"); + + $this->assertEquals($this->link->rel, "http://nowhere.invalid/"); + $this->assertEquals($this->link->title, "Somewhere"); + $this->assertEquals($this->link->href, "http://somewhere.invalid/"); + $this->assertEquals($this->link->type, "text/plain"); + $this->assertEquals($this->link->webcontent->url, "a"); + $this->assertEquals($this->link->webcontent->height, "1"); + $this->assertEquals($this->link->webcontent->width, "2"); + + $this->assertEquals(count($this->link->extensionElements), 0); + $newLink = new Zend_Gdata_Calendar_Extension_Link(); + $newLink->transferFromXML($this->link->saveXML()); + $this->assertEquals(count($newLink->extensionElements), 0); + $newLink->extensionElements = array( + new Zend_Gdata_App_Extension_Element('foo', 'atom', null, 'bar')); + $this->assertEquals(count($newLink->extensionElements), 1); + $this->assertEquals($newLink->rel, "http://nowhere.invalid/"); + $this->assertEquals($newLink->title, "Somewhere"); + $this->assertEquals($newLink->href, "http://somewhere.invalid/"); + $this->assertEquals($newLink->type, "text/plain"); + $this->assertEquals($newLink->webcontent->url, "a"); + $this->assertEquals($newLink->webcontent->height, "1"); + $this->assertEquals($newLink->webcontent->width, "2"); + + /* try constructing using magic factory */ + $cal = new Zend_Gdata_Calendar(); + $newLink2 = $cal->newLink(); + $newLink2->transferFromXML($newLink->saveXML()); + $this->assertEquals(count($newLink2->extensionElements), 1); + $this->assertEquals($newLink2->rel, "http://nowhere.invalid/"); + $this->assertEquals($newLink2->title, "Somewhere"); + $this->assertEquals($newLink2->href, "http://somewhere.invalid/"); + $this->assertEquals($newLink2->type, "text/plain"); + $this->assertEquals($newLink2->webcontent->url, "a"); + $this->assertEquals($newLink2->webcontent->height, "1"); + $this->assertEquals($newLink2->webcontent->width, "2"); + } + + public function testEmptyLinkToAndFromStringShouldMatch() { + $linkXml = $this->link->saveXML(); + $newLink = new Zend_Gdata_Calendar_Extension_Link(); + $newLink->transferFromXML($linkXml); + $newLinkXml = $newLink->saveXML(); + $this->assertTrue($linkXml == $newLinkXml); + } + + public function testLinkWithValueToAndFromStringShouldMatch() { + $this->link->rel = "http://nowhere.invalid/"; + $this->link->title = "Somewhere"; + $this->link->href = "http://somewhere.invalid/"; + $this->link->type = "text/plain"; + $this->link->webContent = new Zend_Gdata_Calendar_Extension_WebContent("a", "1", "2"); + $linkXml = $this->link->saveXML(); + $newLink = new Zend_Gdata_Calendar_Extension_Link(); + $newLink->transferFromXML($linkXml); + $newLinkXml = $newLink->saveXML(); + $this->assertTrue($linkXml == $newLinkXml); + $this->assertEquals($this->link->rel, "http://nowhere.invalid/"); + $this->assertEquals($this->link->title, "Somewhere"); + $this->assertEquals($this->link->href, "http://somewhere.invalid/"); + $this->assertEquals($this->link->type, "text/plain"); + $this->assertEquals($this->link->webcontent->url, "a"); + $this->assertEquals($this->link->webcontent->height, "1"); + $this->assertEquals($this->link->webcontent->width, "2"); + } + + public function testExtensionAttributes() { + $extensionAttributes = $this->link->extensionAttributes; + $extensionAttributes['foo1'] = array('name'=>'foo1', 'value'=>'bar'); + $extensionAttributes['foo2'] = array('name'=>'foo2', 'value'=>'rab'); + $this->link->extensionAttributes = $extensionAttributes; + $this->assertEquals('bar', $this->link->extensionAttributes['foo1']['value']); + $this->assertEquals('rab', $this->link->extensionAttributes['foo2']['value']); + $linkXml = $this->link->saveXML(); + $newLink = new Zend_Gdata_Calendar_Extension_Link(); + $newLink->transferFromXML($linkXml); + $this->assertEquals('bar', $newLink->extensionAttributes['foo1']['value']); + $this->assertEquals('rab', $newLink->extensionAttributes['foo2']['value']); + } + + public function testConvertFullLinkToAndFromString() { + $this->link->transferFromXML($this->linkText); + $this->assertEquals($this->link->rel, "http://schemas.google.com/gCal/2005/webContent"); + $this->assertEquals($this->link->title, "Independence Day"); + $this->assertEquals($this->link->href, "http://www.google.com/calendar/images/google-holiday.gif"); + $this->assertEquals($this->link->type, "image/gif"); + $this->assertEquals($this->link->webcontent->url, "http://www.google.com/logos/july4th06.gif"); + $this->assertEquals($this->link->webcontent->height, "120"); + $this->assertEquals($this->link->webcontent->width, "276"); + } + +} diff --git a/zend/tests/Zend/Gdata/Calendar/QuickAddTest.php b/zend/tests/Zend/Gdata/Calendar/QuickAddTest.php new file mode 100644 index 0000000..bbeb472 --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/QuickAddTest.php @@ -0,0 +1,124 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id $ + */ + +require_once 'Zend/Gdata/Calendar/Extension/QuickAdd.php'; +require_once 'Zend/Gdata/Calendar.php'; + +/** + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @group Zend_Gdata + * @group Zend_Gdata_Calendar + */ +class Zend_Gdata_Calendar_QuickAddTest extends PHPUnit_Framework_TestCase +{ + + public function setUp() { + $this->quickAddText = file_get_contents( + 'Zend/Gdata/Calendar/_files/QuickAddElementSample1.xml', + true); + $this->quickAdd = new Zend_Gdata_Calendar_Extension_QuickAdd(); + } + + public function testEmptyQuickAddShouldHaveNoExtensionElements() { + $this->assertTrue(is_array($this->quickAdd->extensionElements)); + $this->assertTrue(count($this->quickAdd->extensionElements) == 0); + } + + public function testEmptyQuickAddShouldHaveNoExtensionAttributes() { + $this->assertTrue(is_array($this->quickAdd->extensionAttributes)); + $this->assertTrue(count($this->quickAdd->extensionAttributes) == 0); + } + + public function testSampleQuickAddShouldHaveNoExtensionElements() { + $this->quickAdd->transferFromXML($this->quickAddText); + $this->assertTrue(is_array($this->quickAdd->extensionElements)); + $this->assertTrue(count($this->quickAdd->extensionElements) == 0); + } + + public function testSampleQuickAddShouldHaveNoExtensionAttributes() { + $this->quickAdd->transferFromXML($this->quickAddText); + $this->assertTrue(is_array($this->quickAdd->extensionAttributes)); + $this->assertTrue(count($this->quickAdd->extensionAttributes) == 0); + } + + public function testNormalQuickAddShouldHaveNoExtensionElements() { + $this->quickAdd->value = false; + $this->assertEquals($this->quickAdd->value, false); + $this->assertEquals(count($this->quickAdd->extensionElements), 0); + $newQuickAdd = new Zend_Gdata_Calendar_Extension_QuickAdd(); + $newQuickAdd->transferFromXML($this->quickAdd->saveXML()); + $this->assertEquals(count($newQuickAdd->extensionElements), 0); + $newQuickAdd->extensionElements = array( + new Zend_Gdata_App_Extension_Element('foo', 'atom', null, 'bar')); + $this->assertEquals(count($newQuickAdd->extensionElements), 1); + $this->assertEquals($newQuickAdd->value, false); + + /* try constructing using magic factory */ + $cal = new Zend_Gdata_Calendar(); + $newQuickAdd2 = $cal->newQuickAdd(); + $newQuickAdd2->transferFromXML($newQuickAdd->saveXML()); + $this->assertEquals(count($newQuickAdd2->extensionElements), 1); + $this->assertEquals($newQuickAdd2->value, false); + } + + public function testEmptyQuickAddToAndFromStringShouldMatch() { + $quickAddXml = $this->quickAdd->saveXML(); + $newQuickAdd = new Zend_Gdata_Calendar_Extension_QuickAdd(); + $newQuickAdd->transferFromXML($quickAddXml); + $newQuickAddXml = $newQuickAdd->saveXML(); + $this->assertTrue($quickAddXml == $newQuickAddXml); + } + + public function testQuickAddWithValueToAndFromStringShouldMatch() { + $this->quickAdd->value = false; + $quickAddXml = $this->quickAdd->saveXML(); + $newQuickAdd = new Zend_Gdata_Calendar_Extension_QuickAdd(); + $newQuickAdd->transferFromXML($quickAddXml); + $newQuickAddXml = $newQuickAdd->saveXML(); + $this->assertTrue($quickAddXml == $newQuickAddXml); + $this->assertEquals(false, $newQuickAdd->value); + } + + public function testExtensionAttributes() { + $extensionAttributes = $this->quickAdd->extensionAttributes; + $extensionAttributes['foo1'] = array('name'=>'foo1', 'value'=>'bar'); + $extensionAttributes['foo2'] = array('name'=>'foo2', 'value'=>'rab'); + $this->quickAdd->extensionAttributes = $extensionAttributes; + $this->assertEquals('bar', $this->quickAdd->extensionAttributes['foo1']['value']); + $this->assertEquals('rab', $this->quickAdd->extensionAttributes['foo2']['value']); + $quickAddXml = $this->quickAdd->saveXML(); + $newQuickAdd = new Zend_Gdata_Calendar_Extension_QuickAdd(); + $newQuickAdd->transferFromXML($quickAddXml); + $this->assertEquals('bar', $newQuickAdd->extensionAttributes['foo1']['value']); + $this->assertEquals('rab', $newQuickAdd->extensionAttributes['foo2']['value']); + } + + public function testConvertFullQuickAddToAndFromString() { + $this->quickAdd->transferFromXML($this->quickAddText); + $this->assertEquals($this->quickAdd->value, true); + } + +} diff --git a/zend/tests/Zend/Gdata/Calendar/SelectedTest.php b/zend/tests/Zend/Gdata/Calendar/SelectedTest.php new file mode 100644 index 0000000..1abc205 --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/SelectedTest.php @@ -0,0 +1,124 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id $ + */ + +require_once 'Zend/Gdata/Calendar/Extension/Selected.php'; +require_once 'Zend/Gdata/Calendar.php'; + +/** + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @group Zend_Gdata + * @group Zend_Gdata_Calendar + */ +class Zend_Gdata_Calendar_SelectedTest extends PHPUnit_Framework_TestCase +{ + + public function setUp() { + $this->selectedText = file_get_contents( + 'Zend/Gdata/Calendar/_files/SelectedElementSample1.xml', + true); + $this->selected = new Zend_Gdata_Calendar_Extension_Selected(); + } + + public function testEmptySelectedShouldHaveNoExtensionElements() { + $this->assertTrue(is_array($this->selected->extensionElements)); + $this->assertTrue(count($this->selected->extensionElements) == 0); + } + + public function testEmptySelectedShouldHaveNoExtensionAttributes() { + $this->assertTrue(is_array($this->selected->extensionAttributes)); + $this->assertTrue(count($this->selected->extensionAttributes) == 0); + } + + public function testSampleSelectedShouldHaveNoExtensionElements() { + $this->selected->transferFromXML($this->selectedText); + $this->assertTrue(is_array($this->selected->extensionElements)); + $this->assertTrue(count($this->selected->extensionElements) == 0); + } + + public function testSampleSelectedShouldHaveNoExtensionAttributes() { + $this->selected->transferFromXML($this->selectedText); + $this->assertTrue(is_array($this->selected->extensionAttributes)); + $this->assertTrue(count($this->selected->extensionAttributes) == 0); + } + + public function testNormalSelectedShouldHaveNoExtensionElements() { + $this->selected->value = true; + $this->assertEquals($this->selected->value, true); + $this->assertEquals(count($this->selected->extensionElements), 0); + $newSelected = new Zend_Gdata_Calendar_Extension_Selected(); + $newSelected->transferFromXML($this->selected->saveXML()); + $this->assertEquals(count($newSelected->extensionElements), 0); + $newSelected->extensionElements = array( + new Zend_Gdata_App_Extension_Element('foo', 'atom', null, 'bar')); + $this->assertEquals(count($newSelected->extensionElements), 1); + $this->assertEquals($newSelected->value, true); + + /* try constructing using magic factory */ + $cal = new Zend_Gdata_Calendar(); + $newSelected2 = $cal->newSelected(); + $newSelected2->transferFromXML($newSelected->saveXML()); + $this->assertEquals(count($newSelected2->extensionElements), 1); + $this->assertEquals($newSelected2->value, true); + } + + public function testEmptySelectedToAndFromStringShouldMatch() { + $selectedXml = $this->selected->saveXML(); + $newSelected = new Zend_Gdata_Calendar_Extension_Selected(); + $newSelected->transferFromXML($selectedXml); + $newSelectedXml = $newSelected->saveXML(); + $this->assertTrue($selectedXml == $newSelectedXml); + } + + public function testSelectedWithValueToAndFromStringShouldMatch() { + $this->selected->value = true; + $selectedXml = $this->selected->saveXML(); + $newSelected = new Zend_Gdata_Calendar_Extension_Selected(); + $newSelected->transferFromXML($selectedXml); + $newSelectedXml = $newSelected->saveXML(); + $this->assertTrue($selectedXml == $newSelectedXml); + $this->assertEquals(true, $newSelected->value); + } + + public function testExtensionAttributes() { + $extensionAttributes = $this->selected->extensionAttributes; + $extensionAttributes['foo1'] = array('name'=>'foo1', 'value'=>'bar'); + $extensionAttributes['foo2'] = array('name'=>'foo2', 'value'=>'rab'); + $this->selected->extensionAttributes = $extensionAttributes; + $this->assertEquals('bar', $this->selected->extensionAttributes['foo1']['value']); + $this->assertEquals('rab', $this->selected->extensionAttributes['foo2']['value']); + $selectedXml = $this->selected->saveXML(); + $newSelected = new Zend_Gdata_Calendar_Extension_Selected(); + $newSelected->transferFromXML($selectedXml); + $this->assertEquals('bar', $newSelected->extensionAttributes['foo1']['value']); + $this->assertEquals('rab', $newSelected->extensionAttributes['foo2']['value']); + } + + public function testConvertFullSelectedToAndFromString() { + $this->selected->transferFromXML($this->selectedText); + $this->assertEquals($this->selected->value, false); + } + +} diff --git a/zend/tests/Zend/Gdata/Calendar/SendEventNotificationsTest.php b/zend/tests/Zend/Gdata/Calendar/SendEventNotificationsTest.php new file mode 100644 index 0000000..e8d3890 --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/SendEventNotificationsTest.php @@ -0,0 +1,124 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id $ + */ + +require_once 'Zend/Gdata/Calendar/Extension/SendEventNotifications.php'; +require_once 'Zend/Gdata/Calendar.php'; + +/** + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @group Zend_Gdata + * @group Zend_Gdata_Calendar + */ +class Zend_Gdata_Calendar_SendEventNotificationsTest extends PHPUnit_Framework_TestCase +{ + + public function setUp() { + $this->sendEventNotificationsText = file_get_contents( + 'Zend/Gdata/Calendar/_files/SendEventNotificationsElementSample1.xml', + true); + $this->sendEventNotifications = new Zend_Gdata_Calendar_Extension_SendEventNotifications(); + } + + public function testEmptySendEventNotificationsShouldHaveNoExtensionElements() { + $this->assertTrue(is_array($this->sendEventNotifications->extensionElements)); + $this->assertTrue(count($this->sendEventNotifications->extensionElements) == 0); + } + + public function testEmptySendEventNotificationsShouldHaveNoExtensionAttributes() { + $this->assertTrue(is_array($this->sendEventNotifications->extensionAttributes)); + $this->assertTrue(count($this->sendEventNotifications->extensionAttributes) == 0); + } + + public function testSampleSendEventNotificationsShouldHaveNoExtensionElements() { + $this->sendEventNotifications->transferFromXML($this->sendEventNotificationsText); + $this->assertTrue(is_array($this->sendEventNotifications->extensionElements)); + $this->assertTrue(count($this->sendEventNotifications->extensionElements) == 0); + } + + public function testSampleSendEventNotificationsShouldHaveNoExtensionAttributes() { + $this->sendEventNotifications->transferFromXML($this->sendEventNotificationsText); + $this->assertTrue(is_array($this->sendEventNotifications->extensionAttributes)); + $this->assertTrue(count($this->sendEventNotifications->extensionAttributes) == 0); + } + + public function testNormalSendEventNotificationsShouldHaveNoExtensionElements() { + $this->sendEventNotifications->value = true; + $this->assertEquals($this->sendEventNotifications->value, true); + $this->assertEquals(count($this->sendEventNotifications->extensionElements), 0); + $newSendEventNotifications = new Zend_Gdata_Calendar_Extension_SendEventNotifications(); + $newSendEventNotifications->transferFromXML($this->sendEventNotifications->saveXML()); + $this->assertEquals(count($newSendEventNotifications->extensionElements), 0); + $newSendEventNotifications->extensionElements = array( + new Zend_Gdata_App_Extension_Element('foo', 'atom', null, 'bar')); + $this->assertEquals(count($newSendEventNotifications->extensionElements), 1); + $this->assertEquals($newSendEventNotifications->value, true); + + /* try constructing using magic factory */ + $cal = new Zend_Gdata_Calendar(); + $newSendEventNotifications2 = $cal->newSendEventNotifications(); + $newSendEventNotifications2->transferFromXML($newSendEventNotifications->saveXML()); + $this->assertEquals(count($newSendEventNotifications2->extensionElements), 1); + $this->assertEquals($newSendEventNotifications2->value, true); + } + + public function testEmptySendEventNotificationsToAndFromStringShouldMatch() { + $sendEventNotificationsXml = $this->sendEventNotifications->saveXML(); + $newSendEventNotifications = new Zend_Gdata_Calendar_Extension_SendEventNotifications(); + $newSendEventNotifications->transferFromXML($sendEventNotificationsXml); + $newSendEventNotificationsXml = $newSendEventNotifications->saveXML(); + $this->assertTrue($sendEventNotificationsXml == $newSendEventNotificationsXml); + } + + public function testSendEventNotificationsWithValueToAndFromStringShouldMatch() { + $this->sendEventNotifications->value = true; + $sendEventNotificationsXml = $this->sendEventNotifications->saveXML(); + $newSendEventNotifications = new Zend_Gdata_Calendar_Extension_SendEventNotifications(); + $newSendEventNotifications->transferFromXML($sendEventNotificationsXml); + $newSendEventNotificationsXml = $newSendEventNotifications->saveXML(); + $this->assertTrue($sendEventNotificationsXml == $newSendEventNotificationsXml); + $this->assertEquals(true, $newSendEventNotifications->value); + } + + public function testExtensionAttributes() { + $extensionAttributes = $this->sendEventNotifications->extensionAttributes; + $extensionAttributes['foo1'] = array('name'=>'foo1', 'value'=>'bar'); + $extensionAttributes['foo2'] = array('name'=>'foo2', 'value'=>'rab'); + $this->sendEventNotifications->extensionAttributes = $extensionAttributes; + $this->assertEquals('bar', $this->sendEventNotifications->extensionAttributes['foo1']['value']); + $this->assertEquals('rab', $this->sendEventNotifications->extensionAttributes['foo2']['value']); + $sendEventNotificationsXml = $this->sendEventNotifications->saveXML(); + $newSendEventNotifications = new Zend_Gdata_Calendar_Extension_SendEventNotifications(); + $newSendEventNotifications->transferFromXML($sendEventNotificationsXml); + $this->assertEquals('bar', $newSendEventNotifications->extensionAttributes['foo1']['value']); + $this->assertEquals('rab', $newSendEventNotifications->extensionAttributes['foo2']['value']); + } + + public function testConvertFullSendEventNotificationsToAndFromString() { + $this->sendEventNotifications->transferFromXML($this->sendEventNotificationsText); + $this->assertEquals($this->sendEventNotifications->value, false); + } + +} diff --git a/zend/tests/Zend/Gdata/Calendar/TimezoneTest.php b/zend/tests/Zend/Gdata/Calendar/TimezoneTest.php new file mode 100644 index 0000000..1ec29a0 --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/TimezoneTest.php @@ -0,0 +1,124 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id $ + */ + +require_once 'Zend/Gdata/Calendar/Extension/Timezone.php'; +require_once 'Zend/Gdata/Calendar.php'; + +/** + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @group Zend_Gdata + * @group Zend_Gdata_Calendar + */ +class Zend_Gdata_Calendar_TimezoneTest extends PHPUnit_Framework_TestCase +{ + + public function setUp() { + $this->timezoneText = file_get_contents( + 'Zend/Gdata/Calendar/_files/TimezoneElementSample1.xml', + true); + $this->timezone = new Zend_Gdata_Calendar_Extension_Timezone(); + } + + public function testEmptyTimezoneShouldHaveNoExtensionElements() { + $this->assertTrue(is_array($this->timezone->extensionElements)); + $this->assertTrue(count($this->timezone->extensionElements) == 0); + } + + public function testEmptyTimezoneShouldHaveNoExtensionAttributes() { + $this->assertTrue(is_array($this->timezone->extensionAttributes)); + $this->assertTrue(count($this->timezone->extensionAttributes) == 0); + } + + public function testSampleTimezoneShouldHaveNoExtensionElements() { + $this->timezone->transferFromXML($this->timezoneText); + $this->assertTrue(is_array($this->timezone->extensionElements)); + $this->assertTrue(count($this->timezone->extensionElements) == 0); + } + + public function testSampleTimezoneShouldHaveNoExtensionAttributes() { + $this->timezone->transferFromXML($this->timezoneText); + $this->assertTrue(is_array($this->timezone->extensionAttributes)); + $this->assertTrue(count($this->timezone->extensionAttributes) == 0); + } + + public function testNormalTimezoneShouldHaveNoExtensionElements() { + $this->timezone->value = "America/Chicago"; + $this->assertEquals($this->timezone->value, "America/Chicago"); + $this->assertEquals(count($this->timezone->extensionElements), 0); + $newTimezone = new Zend_Gdata_Calendar_Extension_Timezone(); + $newTimezone->transferFromXML($this->timezone->saveXML()); + $this->assertEquals(count($newTimezone->extensionElements), 0); + $newTimezone->extensionElements = array( + new Zend_Gdata_App_Extension_Element('foo', 'atom', null, 'bar')); + $this->assertEquals(count($newTimezone->extensionElements), 1); + $this->assertEquals($newTimezone->value, "America/Chicago"); + + /* try constructing using magic factory */ + $cal = new Zend_Gdata_Calendar(); + $newTimezone2 = $cal->newTimezone(); + $newTimezone2->transferFromXML($newTimezone->saveXML()); + $this->assertEquals(count($newTimezone2->extensionElements), 1); + $this->assertEquals($newTimezone2->value, "America/Chicago"); + } + + public function testEmptyTimezoneToAndFromStringShouldMatch() { + $timezoneXml = $this->timezone->saveXML(); + $newTimezone = new Zend_Gdata_Calendar_Extension_Timezone(); + $newTimezone->transferFromXML($timezoneXml); + $newTimezoneXml = $newTimezone->saveXML(); + $this->assertTrue($timezoneXml == $newTimezoneXml); + } + + public function testTimezoneWithValueToAndFromStringShouldMatch() { + $this->timezone->value = "America/Chicago"; + $timezoneXml = $this->timezone->saveXML(); + $newTimezone = new Zend_Gdata_Calendar_Extension_Timezone(); + $newTimezone->transferFromXML($timezoneXml); + $newTimezoneXml = $newTimezone->saveXML(); + $this->assertTrue($timezoneXml == $newTimezoneXml); + $this->assertEquals("America/Chicago", $newTimezone->value); + } + + public function testExtensionAttributes() { + $extensionAttributes = $this->timezone->extensionAttributes; + $extensionAttributes['foo1'] = array('name'=>'foo1', 'value'=>'bar'); + $extensionAttributes['foo2'] = array('name'=>'foo2', 'value'=>'rab'); + $this->timezone->extensionAttributes = $extensionAttributes; + $this->assertEquals('bar', $this->timezone->extensionAttributes['foo1']['value']); + $this->assertEquals('rab', $this->timezone->extensionAttributes['foo2']['value']); + $timezoneXml = $this->timezone->saveXML(); + $newTimezone = new Zend_Gdata_Calendar_Extension_Timezone(); + $newTimezone->transferFromXML($timezoneXml); + $this->assertEquals('bar', $newTimezone->extensionAttributes['foo1']['value']); + $this->assertEquals('rab', $newTimezone->extensionAttributes['foo2']['value']); + } + + public function testConvertFullTimezoneToAndFromString() { + $this->timezone->transferFromXML($this->timezoneText); + $this->assertEquals($this->timezone->value, "America/Los_Angeles"); + } + +} diff --git a/zend/tests/Zend/Gdata/Calendar/WebContentTest.php b/zend/tests/Zend/Gdata/Calendar/WebContentTest.php new file mode 100644 index 0000000..ab959a5 --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/WebContentTest.php @@ -0,0 +1,140 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id $ + */ + +require_once 'Zend/Gdata/Calendar/Extension/WebContent.php'; +require_once 'Zend/Gdata/Calendar.php'; + +/** + * @category Zend + * @package Zend_Gdata_Calendar + * @subpackage UnitTests + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @group Zend_Gdata + * @group Zend_Gdata_Calendar + */ +class Zend_Gdata_Calendar_WebContentTest extends PHPUnit_Framework_TestCase +{ + + public function setUp() { + $this->webContentText = file_get_contents( + 'Zend/Gdata/Calendar/_files/WebContentElementSample1.xml', + true); + $this->webContent = new Zend_Gdata_Calendar_Extension_WebContent(); + } + + public function testEmptyWebContentShouldHaveNoExtensionElements() { + $this->assertTrue(is_array($this->webContent->extensionElements)); + $this->assertTrue(count($this->webContent->extensionElements) == 0); + } + + public function testEmptyWebContentShouldHaveNoExtensionAttributes() { + $this->assertTrue(is_array($this->webContent->extensionAttributes)); + $this->assertTrue(count($this->webContent->extensionAttributes) == 0); + } + + public function testSampleWebContentShouldHaveNoExtensionElements() { + $this->webContent->transferFromXML($this->webContentText); + $this->assertTrue(is_array($this->webContent->extensionElements)); + $this->assertTrue(count($this->webContent->extensionElements) == 0); + } + + public function testSampleWebContentShouldHaveNoExtensionAttributes() { + $this->webContent->transferFromXML($this->webContentText); + $this->assertTrue(is_array($this->webContent->extensionAttributes)); + $this->assertTrue(count($this->webContent->extensionAttributes) == 0); + } + + public function testNormalWebContentShouldHaveNoExtensionElements() { + $this->webContent->url = "http://nowhere.invalid/"; + $this->webContent->height = "100"; + $this->webContent->width = "200"; + + $this->assertEquals($this->webContent->url, "http://nowhere.invalid/"); + $this->assertEquals($this->webContent->height, "100"); + $this->assertEquals($this->webContent->width, "200"); + + $this->assertEquals(count($this->webContent->extensionElements), 0); + $newWebContent = new Zend_Gdata_Calendar_Extension_WebContent(); + $newWebContent->transferFromXML($this->webContent->saveXML()); + $this->assertEquals(count($newWebContent->extensionElements), 0); + $newWebContent->extensionElements = array( + new Zend_Gdata_App_Extension_Element('foo', 'atom', null, 'bar')); + $this->assertEquals(count($newWebContent->extensionElements), 1); + $this->assertEquals($newWebContent->url, "http://nowhere.invalid/"); + $this->assertEquals($newWebContent->height, "100"); + $this->assertEquals($newWebContent->width, "200"); + + /* try constructing using magic factory */ + $cal = new Zend_Gdata_Calendar(); + $newWebContent2 = $cal->newWebContent(); + $newWebContent2->transferFromXML($newWebContent->saveXML()); + $this->assertEquals(count($newWebContent2->extensionElements), 1); + $this->assertEquals($newWebContent2->url, "http://nowhere.invalid/"); + $this->assertEquals($newWebContent2->height, "100"); + $this->assertEquals($newWebContent2->width, "200"); + } + + public function testEmptyWebContentToAndFromStringShouldMatch() { + $webContentXml = $this->webContent->saveXML(); + $newWebContent = new Zend_Gdata_Calendar_Extension_WebContent(); + $newWebContent->transferFromXML($webContentXml); + $newWebContentXml = $newWebContent->saveXML(); + $this->assertTrue($webContentXml == $newWebContentXml); + } + + public function testWebContentWithValueToAndFromStringShouldMatch() { + $this->webContent->url = "http://nowhere.invalid/"; + $this->webContent->height = "100"; + $this->webContent->width = "200"; + $webContentXml = $this->webContent->saveXML(); + $newWebContent = new Zend_Gdata_Calendar_Extension_WebContent(); + $newWebContent->transferFromXML($webContentXml); + $newWebContentXml = $newWebContent->saveXML(); + $this->assertTrue($webContentXml == $newWebContentXml); + $this->assertEquals($this->webContent->url, "http://nowhere.invalid/"); + $this->assertEquals($this->webContent->height, "100"); + $this->assertEquals($this->webContent->width, "200"); + } + + public function testExtensionAttributes() { + $extensionAttributes = $this->webContent->extensionAttributes; + $extensionAttributes['foo1'] = array('name'=>'foo1', 'value'=>'bar'); + $extensionAttributes['foo2'] = array('name'=>'foo2', 'value'=>'rab'); + $this->webContent->extensionAttributes = $extensionAttributes; + $this->assertEquals('bar', $this->webContent->extensionAttributes['foo1']['value']); + $this->assertEquals('rab', $this->webContent->extensionAttributes['foo2']['value']); + $webContentXml = $this->webContent->saveXML(); + $newWebContent = new Zend_Gdata_Calendar_Extension_WebContent(); + $newWebContent->transferFromXML($webContentXml); + $this->assertEquals('bar', $newWebContent->extensionAttributes['foo1']['value']); + $this->assertEquals('rab', $newWebContent->extensionAttributes['foo2']['value']); + } + + public function testConvertFullWebContentToAndFromString() { + $this->webContent->transferFromXML($this->webContentText); + $this->assertEquals($this->webContent->url, "http://www.google.com/logos/july4th06.gif"); + $this->assertEquals($this->webContent->height, "120"); + $this->assertEquals($this->webContent->width, "276"); + } + +} diff --git a/zend/tests/Zend/Gdata/Calendar/_files/AccessLevelElementSample1.xml b/zend/tests/Zend/Gdata/Calendar/_files/AccessLevelElementSample1.xml new file mode 100644 index 0000000..47843bc --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/_files/AccessLevelElementSample1.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" ?> +<accesslevel xmlns="http://schemas.google.com/gCal/2005" value="owner"/> diff --git a/zend/tests/Zend/Gdata/Calendar/_files/ColorElementSample1.xml b/zend/tests/Zend/Gdata/Calendar/_files/ColorElementSample1.xml new file mode 100644 index 0000000..8e9f29b --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/_files/ColorElementSample1.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" ?> +<color xmlns="http://schemas.google.com/gCal/2005" value="#5A6986"/> diff --git a/zend/tests/Zend/Gdata/Calendar/_files/EventEntrySample1.xml b/zend/tests/Zend/Gdata/Calendar/_files/EventEntrySample1.xml new file mode 100644 index 0000000..8c4763b --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/_files/EventEntrySample1.xml @@ -0,0 +1,51 @@ +<?xml version='1.0' encoding='utf-8'?> +<entry xmlns='http://www.w3.org/2005/Atom' +xmlns:gd='http://schemas.google.com/g/2005' +xmlns:gCal='http://schemas.google.com/gCal/2005'> + <id> + http://www.google.com/calendar/feeds/default/private/full/s0dtsvq4pe15ku09jideg67fv4_20070509T193000Z</id> + <published>2007-05-09T16:32:03.000Z</published> + <updated>2007-05-09T16:34:33.000Z</updated> + <category scheme='http://schemas.google.com/g/2005#kind' + term='http://schemas.google.com/g/2005#event'></category> + <title type='text'>www2007 recurring</title> + <content type='text'></content> + <link rel='alternate' type='text/html' + href='http://www.google.com/calendar/event?eid=czBkdHN2cTRwZTE1a3UwOWppZGVnNjdmdjRfMjAwNzA1MDlUMTkzMDAwWiBnZGF0YS5vcHMudGVzdEBt' + title='alternate'></link> + <link rel='self' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full/s0dtsvq4pe15ku09jideg67fv4_20070509T193000Z'> + </link> + <link rel='edit' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full/s0dtsvq4pe15ku09jideg67fv4_20070509T193000Z/63314411673'> + </link> + <author> + <name>gdata ops</name> + <email>gdata.ops.test@gmail.com</email> + </author> + <gd:originalEvent id='s0dtsvq4pe15ku09jideg67fv4' + href='http://www.google.com/calendar/feeds/default/private/full/s0dtsvq4pe15ku09jideg67fv4'> + <gd:when startTime='2007-05-09T14:30:00.000-05:00'></gd:when> + </gd:originalEvent> + <gd:comments> + <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/s0dtsvq4pe15ku09jideg67fv4_20070509T193000Z/comments'> + </gd:feedLink> + </gd:comments> + <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'> + </gd:eventStatus> + <gd:visibility value='http://schemas.google.com/g/2005#event.default'> + </gd:visibility> + <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> + </gd:transparency> + <gCal:sendEventNotifications value='false'> + </gCal:sendEventNotifications> + <gCal:timezone value='America/Los_Angeles'> + </gCal:timezone> + <gd:when startTime='2007-05-09T17:30:00.000-05:00' + endTime='2007-05-09T18:30:00.000-05:00'> + <gd:reminder minutes='10' method='alert'></gd:reminder> + <gd:reminder minutes='10' method='email'></gd:reminder> + </gd:when> + <gd:where valueString='Down by the river'></gd:where> + <gd:extendedProperty name='http://frank.schemas/2005#prop' value='Mantek' /> +</entry> diff --git a/zend/tests/Zend/Gdata/Calendar/_files/EventFeedCompositeSample1.xml b/zend/tests/Zend/Gdata/Calendar/_files/EventFeedCompositeSample1.xml new file mode 100644 index 0000000..32eb50c --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/_files/EventFeedCompositeSample1.xml @@ -0,0 +1,362 @@ +<?xml version="1.0"?> +<feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:gd="http://schemas.google.com/g/2005" xmlns:gCal="http://schemas.google.com/gCal/2005"> + <id>http://www.google.com/calendar/feeds/default/private/composite</id> + <updated>2007-05-31T01:15:00.000Z</updated> + <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/g/2005#event"/> + <title type="text">GData Ops Demo's Composite View</title> + <subtitle type="text">GData Is Awesome</subtitle> + <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.google.com/calendar/feeds/default/private/composite"/> + <link rel="self" type="application/atom+xml" href="http://www.google.com/calendar/feeds/default/private/composite?max-results=25"/> + <author> + <name>GData Ops Demo</name> + <email>gdata.ops.demo@gmail.com</email> + </author> + <generator version="1.0" uri="http://www.google.com/calendar">Google Calendar</generator> + <openSearch:totalResults>7</openSearch:totalResults> + <openSearch:startIndex>1</openSearch:startIndex> + <openSearch:itemsPerPage>25</openSearch:itemsPerPage> + <gCal:timezone value="America/Chicago"/> + <entry> + <id> + http://www.google.com/calendar/feeds/default/private/composite/5v9l3sqdqt0b7mg1nhnmgdfup8</id> + <published>2007-09-14T15:37:53.000Z</published> + <updated>2007-09-14T15:37:53.000Z</updated> + <category scheme='http://schemas.google.com/g/2005#kind' + term='http://schemas.google.com/g/2005#event' /> + <title type='text'>Specialized Event</title> + <content type='text'></content> + <link rel='alternate' type='text/html' + href='http://www.google.com/calendar/event?eid=NXY5bDNzcWRxdDBiN21nMW5obm1nZGZ1cDhfMjAwNzA5MTNUMTUwMDAwWiBnZGF0YS5vcHMuZGVtb0Bt' + title='alternate' /> + <link rel='self' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/composite/5v9l3sqdqt0b7mg1nhnmgdfup8' /> + <author> + <name>GData Ops Demo</name> + <email>gdata.ops.demo@gmail.com</email> + </author> + <gd:recurrence>DTSTART;TZID=America/Los_Angeles:20070913T080000 + DTEND;TZID=America/Los_Angeles:20070913T090000 + RRULE:FREQ=DAILY;UNTIL=20070920T150000Z;WKST=SU BEGIN:VTIMEZONE + TZID:America/Los_Angeles X-LIC-LOCATION:America/Los_Angeles + BEGIN:DAYLIGHT TZOFFSETFROM:-0800 TZOFFSETTO:-0700 TZNAME:PDT + DTSTART:19700308T020000 RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU + END:DAYLIGHT BEGIN:STANDARD TZOFFSETFROM:-0700 TZOFFSETTO:-0800 + TZNAME:PST DTSTART:19701101T020000 + RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU END:STANDARD + END:VTIMEZONE</gd:recurrence> + <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed' /> + <gd:visibility value='http://schemas.google.com/g/2005#event.default' /> + <gd:transparency value='http://schemas.google.com/g/2005#event.opaque' /> + <gCal:uid value='5v9l3sqdqt0b7mg1nhnmgdfup8@google.com' /> + <gCal:sequence value='0' /> + <gd:reminder minutes='10' method='sms' /> + <gd:reminder minutes='10' method='alert' /> + <gCal:sendEventNotifications value="false"/> + <gd:recurrenceException specialized='false'> + <gd:entryLink> + <entry> + <id>5v9l3sqdqt0b7mg1nhnmgdfup8_20070914T150000Z</id> + <published>2007-09-14T15:37:53.000Z</published> + <updated>2007-09-14T15:41:06.000Z</updated> + <category scheme='http://schemas.google.com/g/2005#kind' + term='http://schemas.google.com/g/2005#event' /> + <title type='text'>Specialized Event</title> + <content type='text'></content> + <link rel='alternate' type='text/html' + href='http://www.google.com/calendar/event?eid=NXY5bDNzcWRxdDBiN21nMW5obm1nZGZ1cDhfMjAwNzA5MTRUMTUwMDAwWiBnZGF0YS5vcHMuZGVtb0Bt' + title='alternate' /> + <author> + <name>GData Ops Demo</name> + <email>gdata.ops.demo@gmail.com</email> + </author> + <gd:originalEvent id='5v9l3sqdqt0b7mg1nhnmgdfup8' + href='http://www.google.com/calendar/feeds/default/private/composite/5v9l3sqdqt0b7mg1nhnmgdfup8'> + + <gd:when startTime='2007-09-14T08:00:00.000-07:00' /> + </gd:originalEvent> + <gd:comments> + <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/5v9l3sqdqt0b7mg1nhnmgdfup8_20070914T150000Z/comments'> + + <feed> + <id> + http://www.google.com/calendar/feeds/default/private/full/5v9l3sqdqt0b7mg1nhnmgdfup8_20070914T150000Z/comments</id> + <updated>2007-09-14T15:42:41.390Z</updated> + <category scheme='http://schemas.google.com/g/2005#kind' + term='http://schemas.google.com/g/2005#message' /> + <title type='text'>Comments for: Specialized + Event</title> + <link rel='alternate' type='text/html' + href='http://www.google.com/calendar/feeds/default/private/full/5v9l3sqdqt0b7mg1nhnmgdfup8_20070914T150000Z/comments' + title='alternate' /> + </feed> + </gd:feedLink> + </gd:comments> + <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed' /> + <gd:visibility value='http://schemas.google.com/g/2005#event.default' /> + <gd:transparency value='http://schemas.google.com/g/2005#event.opaque' /> + <gCal:uid value='5v9l3sqdqt0b7mg1nhnmgdfup8@google.com' /> + <gCal:sequence value='0' /> + <gd:when startTime='2007-09-14T08:00:00.000-07:00' + endTime='2007-09-14T09:00:00.000-07:00'> + <gd:reminder minutes='10' method='alert' /> + </gd:when> + <gd:who rel='http://schemas.google.com/g/2005#event.attendee' + valueString='gdata ops' email='gdata.ops.test@gmail.com'> + <gd:attendeeStatus value='http://schemas.google.com/g/2005#event.invited' /> + </gd:who> + <gd:who rel='http://schemas.google.com/g/2005#event.organizer' + valueString='GData Ops Demo' + email='gdata.ops.demo@gmail.com'> + <gd:attendeeStatus value='http://schemas.google.com/g/2005#event.accepted' /> + </gd:who> + <gd:where valueString='' /> + </entry> + </gd:entryLink> + </gd:recurrenceException> + <gd:who rel='http://schemas.google.com/g/2005#event.organizer' + valueString='GData Ops Demo' email='gdata.ops.demo@gmail.com'> + <gd:attendeeStatus value='' /> + </gd:who> + <gd:where valueString='' /> + </entry> + <entry> + <id>http://www.google.com/calendar/feeds/default/private/composite/sh6kv08egsls7mc5tf6np8hi9c</id> + <published>2007-05-24T20:49:14.000Z</published> + <updated>2007-05-24T20:49:14.000Z</updated> + <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/g/2005#event"/> + <category scheme="http://schemas.google.com/g/2005" term="http://schemas.google.com/g/2005#event"/> + <title type="text">Tennis Game</title> + <content type="text">Meet for a quick lesson.</content> + <link rel="alternate" type="text/html" href="http://www.google.com/calendar/event?eid=c2g2a3YwOGVnc2xzN21jNXRmNm5wOGhpOWNfMjAwNzA1MDEgZ2RhdGEub3BzLnRlc3RAbQ" title="alternate"/> + <link rel="self" type="application/atom+xml" href="http://www.google.com/calendar/feeds/default/private/composite/sh6kv08egsls7mc5tf6np8hi9c"/> + <author> + <name>GData Ops Demo</name> + <email>gdata.ops.demo@gmail.com</email> + </author> + <gd:recurrence>DTSTART;VALUE=DATE:20070501 DTEND;VALUE=DATE:20070502 RRULE:FREQ=WEEKLY;BYDAY=Tu;UNTIL=20070904</gd:recurrence> + <gd:eventStatus value="http://schemas.google.com/g/2005#event.confirmed"/> + <gd:visibility value="http://schemas.google.com/g/2005#event.default"/> + <gd:transparency value="http://schemas.google.com/g/2005#event.opaque"/> + <gCal:sendEventNotifications value="false"/> + <gd:where valueString="South Tennis Courts"/> + </entry> + <entry> + <id>http://www.google.com/calendar/feeds/default/private/composite/lq2ai6imsbq209q3aeturho50g</id> + <published>2007-05-09T16:44:38.000Z</published> + <updated>2007-05-17T10:33:49.000Z</updated> + <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/g/2005#event"/> + <title type="text">all day event may 24</title> + <content type="text"/> + <link rel="alternate" type="text/html" href="http://www.google.com/calendar/event?eid=bHEyYWk2aW1zYnEyMDlxM2FldHVyaG81MGcgZ2RhdGEub3BzLnRlc3RAbQ" title="alternate"/> + <link rel="self" type="application/atom+xml" href="http://www.google.com/calendar/feeds/default/private/composite/lq2ai6imsbq209q3aeturho50g"/> + <author> + <name>GData Ops Demo</name> + <email>gdata.ops.demo@gmail.com</email> + </author> + <gd:comments> + <gd:feedLink href="http://www.google.com/calendar/feeds/default/private/full/lq2ai6imsbq209q3aeturho50g/comments"> + <feed> + <updated>2007-05-31T01:15:13.249Z</updated> + <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/g/2005#message"/> + <title type="text">Comments for: all day event may 24</title> + <link rel="alternate" type="text/html" href="http://www.google.com/calendar/feeds/default/private/full/lq2ai6imsbq209q3aeturho50g/comments" title="alternate"/> + <entry> + <id>dfr2c8pbtb8g6uphrsrlpao7mc</id> + <published>2007-05-23T20:38:08.000Z</published> + <updated>2007-05-23T20:38:08.000Z</updated> + <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/g/2005#message"/> + <content type="html"><p>This is my comments!</p></content> + <author> + <name>User 1</name> + <email>user1@nowhere.invalid</email> + </author> + </entry> + <entry> + <id>i9q87onko1uphfs7i21elnnb4g</id> + <published>2007-06-01T21:21:47.000Z</published> + <updated>2007-06-01T21:21:47.000Z</updated> + <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/g/2005#message"/> + <content type="html"><p>This is a user supplied comment.</p></content> + <author> + <name>User 2</name> + <email>user2@nowhere.invalid</email> + </author> + </entry> + </feed> + </gd:feedLink> + </gd:comments> + <gd:eventStatus value="http://schemas.google.com/g/2005#event.confirmed"/> + <gd:visibility value="http://schemas.google.com/g/2005#event.default"/> + <gd:transparency value="http://schemas.google.com/g/2005#event.transparent"/> + <gCal:sendEventNotifications value="false"/> + <gd:when startTime="2007-05-24" endTime="2007-05-25"> + <gd:reminder minutes="10" method="alert"/> + <gd:reminder minutes="10" method="email"/> + </gd:when> + <gd:where valueString="Mountain View, California"/> + </entry> + <entry> + <id>http://www.google.com/calendar/feeds/default/private/composite/4v2a4eddoqja2727ptkq78euq8</id> + <published>2007-05-09T16:43:58.000Z</published> + <updated>2007-05-17T10:33:49.000Z</updated> + <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/g/2005#event"/> + <title type="text">all day event may 23</title> + <content type="text"/> + <link rel="alternate" type="text/html" href="http://www.google.com/calendar/event?eid=NHYyYTRlZGRvcWphMjcyN3B0a3E3OGV1cTggZ2RhdGEub3BzLnRlc3RAbQ" title="alternate"/> + <link rel="self" type="application/atom+xml" href="http://www.google.com/calendar/feeds/default/private/composite/4v2a4eddoqja2727ptkq78euq8"/> + <author> + <name>GData Ops Demo</name> + <email>gdata.ops.demo@gmail.com</email> + </author> + <gd:comments> + <gd:feedLink href="http://www.google.com/calendar/feeds/default/private/full/4v2a4eddoqja2727ptkq78euq8/comments"> + <feed> + <updated>2007-05-31T01:15:13.250Z</updated> + <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/g/2005#message"/> + <title type="text">Comments for: all day event may 23</title> + <link rel="alternate" type="text/html" href="http://www.google.com/calendar/feeds/default/private/full/4v2a4eddoqja2727ptkq78euq8/comments" title="alternate"/> + </feed> + </gd:feedLink> + </gd:comments> + <gd:eventStatus value="http://schemas.google.com/g/2005#event.confirmed"/> + <gd:visibility value="http://schemas.google.com/g/2005#event.default"/> + <gd:transparency value="http://schemas.google.com/g/2005#event.transparent"/> + <gCal:sendEventNotifications value="false"/> + <gd:when startTime="2007-05-23" endTime="2007-05-24"> + <gd:reminder minutes="10" method="alert"/> + <gd:reminder minutes="10" method="email"/> + </gd:when> + <gd:where/> + </entry> + <entry> + <id>http://www.google.com/calendar/feeds/default/private/composite/14gfovd20fqvtj1d1np7ei9tbg</id> + <published>2007-05-09T16:43:53.000Z</published> + <updated>2007-05-17T10:33:49.000Z</updated> + <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/g/2005#event"/> + <title type="text">all day event may 22</title> + <content type="text"/> + <link rel="alternate" type="text/html" href="http://www.google.com/calendar/event?eid=MTRnZm92ZDIwZnF2dGoxZDFucDdlaTl0YmcgZ2RhdGEub3BzLnRlc3RAbQ" title="alternate"/> + <link rel="self" type="application/atom+xml" href="http://www.google.com/calendar/feeds/default/private/composite/14gfovd20fqvtj1d1np7ei9tbg"/> + <author> + <name>GData Ops Demo</name> + <email>gdata.ops.demo@gmail.com</email> + </author> + <gd:comments> + <gd:feedLink href="http://www.google.com/calendar/feeds/default/private/full/14gfovd20fqvtj1d1np7ei9tbg/comments"> + <feed> + <updated>2007-05-31T01:15:13.250Z</updated> + <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/g/2005#message"/> + <title type="text">Comments for: all day event may 22</title> + <link rel="alternate" type="text/html" href="http://www.google.com/calendar/feeds/default/private/full/14gfovd20fqvtj1d1np7ei9tbg/comments" title="alternate"/> + </feed> + </gd:feedLink> + </gd:comments> + <gd:eventStatus value="http://schemas.google.com/g/2005#event.confirmed"/> + <gd:visibility value="http://schemas.google.com/g/2005#event.default"/> + <gd:transparency value="http://schemas.google.com/g/2005#event.transparent"/> + <gCal:sendEventNotifications value="false"/> + <gd:when startTime="2007-05-22" endTime="2007-05-23"> + <gd:reminder minutes="10" method="alert"/> + <gd:reminder minutes="10" method="email"/> + </gd:when> + <gd:where/> + </entry> + <entry> + <id>http://www.google.com/calendar/feeds/default/private/composite/s0dtsvq4pe15ku09jideg67fv4_20070509T193000Z</id> + <published>2007-05-09T16:32:03.000Z</published> + <updated>2007-05-09T16:34:33.000Z</updated> + <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/g/2005#event"/> + <title type="text">www2007 recurring</title> + <content type="text"/> + <link rel="alternate" type="text/html" href="http://www.google.com/calendar/event?eid=czBkdHN2cTRwZTE1a3UwOWppZGVnNjdmdjRfMjAwNzA1MDlUMTkzMDAwWiBnZGF0YS5vcHMudGVzdEBt" title="alternate"/> + <link rel="self" type="application/atom+xml" href="http://www.google.com/calendar/feeds/default/private/composite/s0dtsvq4pe15ku09jideg67fv4_20070509T193000Z"/> + <author> + <name>GData Ops Demo</name> + <email>gdata.ops.demo@gmail.com</email> + </author> + <gd:originalEvent id="s0dtsvq4pe15ku09jideg67fv4" href="http://www.google.com/calendar/feeds/default/private/composite/s0dtsvq4pe15ku09jideg67fv4"> + <gd:when startTime="2007-05-09T14:30:00.000-05:00"/> + </gd:originalEvent> + <gd:comments> + <gd:feedLink href="http://www.google.com/calendar/feeds/default/private/full/s0dtsvq4pe15ku09jideg67fv4_20070509T193000Z/comments"> + <feed> + <updated>2007-05-31T01:15:13.251Z</updated> + <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/g/2005#message"/> + <title type="text">Comments for: www2007 recurring</title> + <link rel="alternate" type="text/html" href="http://www.google.com/calendar/feeds/default/private/full/s0dtsvq4pe15ku09jideg67fv4_20070509T193000Z/comments" title="alternate"/> + </feed> + </gd:feedLink> + </gd:comments> + <gd:eventStatus value="http://schemas.google.com/g/2005#event.confirmed"/> + <gd:visibility value="http://schemas.google.com/g/2005#event.default"/> + <gd:transparency value="http://schemas.google.com/g/2005#event.opaque"/> + <gCal:sendEventNotifications value="false"/> + <gd:when startTime="2007-05-09T17:30:00.000-05:00" endTime="2007-05-09T18:30:00.000-05:00"> + <gd:reminder minutes="10" method="alert"/> + <gd:reminder minutes="10" method="email"/> + </gd:when> + <gd:where valueString=""/> + </entry> + <entry> + <id>http://www.google.com/calendar/feeds/default/private/composite/s0dtsvq4pe15ku09jideg67fv4</id> + <published>2007-05-09T16:32:03.000Z</published> + <updated>2007-05-09T16:32:03.000Z</updated> + <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/g/2005#event"/> + <title type="text">www2007 recurring</title> + <content type="text"/> + <link rel="alternate" type="text/html" href="http://www.google.com/calendar/event?eid=czBkdHN2cTRwZTE1a3UwOWppZGVnNjdmdjRfMjAwNzA1MDhUMTkzMDAwWiBnZGF0YS5vcHMudGVzdEBt" title="alternate"/> + <link rel="self" type="application/atom+xml" href="http://www.google.com/calendar/feeds/default/private/composite/s0dtsvq4pe15ku09jideg67fv4"/> + <author> + <name>GData Ops Demo</name> + <email>gdata.ops.demo@gmail.com</email> + </author> + <gd:recurrence>DTSTART;TZID=America/Anchorage:20070508T113000 DTEND;TZID=America/Anchorage:20070508T123000 RRULE:FREQ=DAILY;UNTIL=20070513T193000Z;WKST=SU BEGIN:VTIMEZONE TZID:America/Anchorage X-LIC-LOCATION:America/Anchorage BEGIN:DAYLIGHT TZOFFSETFROM:-0900 TZOFFSETTO:-0800 TZNAME:AKDT DTSTART:19700308T020000 RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU END:DAYLIGHT BEGIN:STANDARD TZOFFSETFROM:-0800 TZOFFSETTO:-0900 TZNAME:AKST DTSTART:19701101T020000 RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU END:STANDARD END:VTIMEZONE</gd:recurrence> + <gd:eventStatus value="http://schemas.google.com/g/2005#event.confirmed"/> + <gd:visibility value="http://schemas.google.com/g/2005#event.default"/> + <gd:transparency value="http://schemas.google.com/g/2005#event.opaque"/> + <gCal:sendEventNotifications value="false"/> + <gd:reminder minutes="10" method="alert"/> + <gd:reminder minutes="10" method="email"/> + <gd:recurrenceException specialized="true"> + <gd:entryLink> + <entry> + <id>s0dtsvq4pe15ku09jideg67fv4_20070509T193000Z</id> + <published>2007-05-09T16:32:03.000Z</published> + <updated>2007-05-09T16:34:33.000Z</updated> + <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/g/2005#event"/> + <title type="text">www2007 recurring</title> + <content type="text"/> + <link rel="alternate" type="text/html" href="http://www.google.com/calendar/event?eid=czBkdHN2cTRwZTE1a3UwOWppZGVnNjdmdjRfMjAwNzA1MDlUMTkzMDAwWiBnZGF0YS5vcHMudGVzdEBt" title="alternate"/> + <author> + <name>GData Ops Demo</name> + <email>gdata.ops.demo@gmail.com</email> + </author> + <gd:originalEvent id="s0dtsvq4pe15ku09jideg67fv4" href="http://www.google.com/calendar/feeds/default/private/composite/s0dtsvq4pe15ku09jideg67fv4"> + <gd:when startTime="2007-05-09T14:30:00.000-05:00"/> + </gd:originalEvent> + <gd:comments> + <gd:feedLink href="http://www.google.com/calendar/feeds/default/private/full/s0dtsvq4pe15ku09jideg67fv4_20070509T193000Z/comments"> + <feed> + <updated>2007-05-31T01:15:13.259Z</updated> + <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/g/2005#message"/> + <title type="text">Comments for: www2007 recurring</title> + <link rel="alternate" type="text/html" href="http://www.google.com/calendar/feeds/default/private/full/s0dtsvq4pe15ku09jideg67fv4_20070509T193000Z/comments" title="alternate"/> + </feed> + </gd:feedLink> + </gd:comments> + <gd:eventStatus value="http://schemas.google.com/g/2005#event.confirmed"/> + <gd:visibility value="http://schemas.google.com/g/2005#event.default"/> + <gd:transparency value="http://schemas.google.com/g/2005#event.opaque"/> + <gCal:sendEventNotifications value="false"/> + <gd:when startTime="2007-05-09T17:30:00.000-05:00" endTime="2007-05-09T18:30:00.000-05:00"> + <gd:reminder minutes="10" method="alert"/> + <gd:reminder minutes="10" method="email"/> + </gd:when> + <gd:where valueString=""/> + </entry> + </gd:entryLink> + </gd:recurrenceException> + <gd:where valueString=""/> + </entry> +</feed> + diff --git a/zend/tests/Zend/Gdata/Calendar/_files/HiddenElementSample1.xml b/zend/tests/Zend/Gdata/Calendar/_files/HiddenElementSample1.xml new file mode 100644 index 0000000..21c03d7 --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/_files/HiddenElementSample1.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" ?> +<hidden xmlns="http://schemas.google.com/gCal/2005" value="false"/> diff --git a/zend/tests/Zend/Gdata/Calendar/_files/LinkElementSample1.xml b/zend/tests/Zend/Gdata/Calendar/_files/LinkElementSample1.xml new file mode 100644 index 0000000..a39056f --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/_files/LinkElementSample1.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8" ?> +<atom:link xmlns:atom="http://www.w3.org/2005/Atom" + rel="http://schemas.google.com/gCal/2005/webContent" + title="Independence Day" + href="http://www.google.com/calendar/images/google-holiday.gif" + type="image/gif"> + <gCal:webContent xmlns:gCal="http://schemas.google.com/gCal/2005" + url="http://www.google.com/logos/july4th06.gif" + width="276" height="120" /> +</atom:link>
\ No newline at end of file diff --git a/zend/tests/Zend/Gdata/Calendar/_files/ListFeedSample1.xml b/zend/tests/Zend/Gdata/Calendar/_files/ListFeedSample1.xml new file mode 100644 index 0000000..3919a78 --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/_files/ListFeedSample1.xml @@ -0,0 +1,192 @@ +<?xml version="1.0"?>
+<feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:gd="http://schemas.google.com/g/2005" xmlns:gCal="http://schemas.google.com/gCal/2005">
+ <id>http://www.google.com/calendar/feeds/default</id>
+ <updated>2007-05-30T00:23:26.998Z</updated>
+ <title type="text">GData Ops Demo's Calendar List</title>
+ <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.google.com/calendar/feeds/default"/>
+ <link rel="http://schemas.google.com/g/2005#post" type="application/atom+xml" href="http://www.google.com/calendar/feeds/default"/>
+ <link rel="self" type="application/atom+xml" href="http://www.google.com/calendar/feeds/default"/>
+ <author>
+ <name>GData Ops Demo</name>
+ <email>gdata.ops.demo@gmail.com</email>
+ <uri>http://test.address.invalid/</uri>
+ </author>
+ <generator version="1.0" uri="http://www.google.com/calendar">Google Calendar</generator>
+ <openSearch:startIndex>1</openSearch:startIndex>
+ <entry>
+ <id>http://www.google.com/calendar/feeds/default/gdata.ops.demo%40gmail.com</id>
+ <published>2007-05-30T00:23:27.006Z</published>
+ <updated>2007-05-30T00:20:38.000Z</updated>
+ <title type="text">GData Ops Demo</title>
+ <link rel="alternate" type="application/atom+xml" href="http://www.google.com/calendar/feeds/gdata.ops.demo%40gmail.com/private/full"/>
+ <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml" href="http://www.google.com/calendar/feeds/gdata.ops.demo%41gmail.com/acl/full"/>
+ <link rel="self" type="application/atom+xml" href="http://www.google.com/calendar/feeds/default/gdata.ops.demo%40gmail.com"/>
+ <author>
+ <name>GData Ops Demo</name>
+ <email>gdata.ops.demo@gmail.com</email>
+ </author>
+ <gCal:timezone value="America/Chicago"/>
+ <gCal:hidden value="false"/>
+ <gCal:color value="#2952A3"/>
+ <gCal:selected value="true"/>
+ <gCal:accesslevel value="owner"/>
+ </entry>
+ <entry>
+ <id>http://www.google.com/calendar/feeds/default/ri3u1buho56d1k2papoec4c16s%40group.calendar.google.com</id>
+ <published>2007-05-30T00:23:27.005Z</published>
+ <updated>2007-05-30T00:20:38.000Z</updated>
+ <title type="text">My Other Awesome Calendar</title>
+ <summary type="text">This is my other calendar.</summary>
+ <link rel="alternate" type="application/atom+xml" href="http://www.google.com/calendar/feeds/ri3u1buho56d1k2papoec4c16s%40group.calendar.google.com/private/full"/>
+ <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml" href="http://www.google.com/calendar/feeds/ri3u1buho56d1k2papoec4c16s%40group.calendar.google.com/acl/full"/>
+ <link rel="self" type="application/atom+xml" href="http://www.google.com/calendar/feeds/default/ri3u1buho56d1k2papoec4c16s%40group.calendar.google.com"/>
+ <author>
+ <name>GData Ops Demo</name>
+ <email>gdata.ops.demo@gmail.com</email>
+ </author>
+ <gCal:timezone value="America/Chicago"/>
+ <gCal:hidden value="false"/>
+ <gCal:color value="#A32929"/>
+ <gCal:selected value="true"/>
+ <gCal:accesslevel value="owner"/>
+ <gd:where valueString="Palo Alto, California"/>
+ </entry>
+ <entry>
+ <id>http://www.google.com/calendar/feeds/default/5fcmq8mrd633rulib1jgtuuk90%40group.calendar.google.com</id>
+ <published>2007-05-30T00:23:27.005Z</published>
+ <updated>2007-05-22T05:35:47.000Z</updated>
+ <title type="text">Sample Calendar A</title>
+ <summary type="text"/>
+ <link rel="alternate" type="application/atom+xml" href="http://www.google.com/calendar/feeds/5fcmq8mrd633rulib1jgtuuk90%40group.calendar.google.com/private/full"/>
+ <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml" href="http://www.google.com/calendar/feeds/5fcmq8mrd633rulib1jgtuuk90%40group.calendar.google.com/acl/full"/>
+ <link rel="self" type="application/atom+xml" href="http://www.google.com/calendar/feeds/default/5fcmq8mrd633rulib1jgtuuk90%40group.calendar.google.com"/>
+ <author>
+ <name>GData Ops Demo</name>
+ <email>gdata.ops.demo@gmail.com</email>
+ </author>
+ <gCal:timezone value="America/Los_Angeles"/>
+ <gCal:hidden value="false"/>
+ <gCal:color value="#5A6986"/>
+ <gCal:selected value="false"/>
+ <gCal:accesslevel value="owner"/>
+ <gd:where valueString=""/>
+ </entry>
+ <entry>
+ <id>http://www.google.com/calendar/feeds/default/a2f8cl1m7ottkhmoita51gu9cc%40group.calendar.google.com</id>
+ <published>2007-05-30T00:23:27.005Z</published>
+ <updated>2007-05-21T07:31:41.000Z</updated>
+ <title type="text">Sample Calendar B</title>
+ <summary type="text"/>
+ <link rel="alternate" type="application/atom+xml" href="http://www.google.com/calendar/feeds/a2f8cl1m7ottkhmoita51gu9cc%40group.calendar.google.com/private/full"/>
+ <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml" href="http://www.google.com/calendar/feeds/a2f8cl1m7ottkhmoita51gu9cc%40group.calendar.google.com/acl/full"/>
+ <link rel="self" type="application/atom+xml" href="http://www.google.com/calendar/feeds/default/a2f8cl1m7ottkhmoita51gu9cc%40group.calendar.google.com"/>
+ <author>
+ <name>GData Ops Demo</name>
+ <email>gdata.ops.demo@gmail.com</email>
+ </author>
+ <gCal:timezone value="America/Los_Angeles"/>
+ <gCal:hidden value="false"/>
+ <gCal:color value="#5A6986"/>
+ <gCal:selected value="false"/>
+ <gCal:accesslevel value="owner"/>
+ <gd:where valueString=""/>
+ </entry>
+ <entry>
+ <id>http://www.google.com/calendar/feeds/default/rndpkbg35nhelu9fbp63u9sgp0%40group.calendar.google.com</id>
+ <published>2007-05-30T00:23:27.006Z</published>
+ <updated>2007-05-22T21:02:34.000Z</updated>
+ <title type="text">Sample Calendar C</title>
+ <summary type="text"/>
+ <link rel="alternate" type="application/atom+xml" href="http://www.google.com/calendar/feeds/rndpkbg35nhelu9fbp63u9sgp0%40group.calendar.google.com/private/full"/>
+ <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml" href="http://www.google.com/calendar/feeds/rndpkbg35nhelu9fbp63u9sgp0%40group.calendar.google.com/acl/full"/>
+ <link rel="self" type="application/atom+xml" href="http://www.google.com/calendar/feeds/default/rndpkbg35nhelu9fbp63u9sgp0%40group.calendar.google.com"/>
+ <author>
+ <name>GData Ops Demo</name>
+ <email>gdata.ops.demo@gmail.com</email>
+ </author>
+ <gCal:timezone value="America/Los_Angeles"/>
+ <gCal:hidden value="false"/>
+ <gCal:color value="#B1440E"/>
+ <gCal:selected value="true"/>
+ <gCal:accesslevel value="owner"/>
+ <gd:where valueString=""/>
+ </entry>
+ <entry>
+ <id>http://www.google.com/calendar/feeds/default/u4u5cksnpp1vufdarpupn5um5s%40group.calendar.google.com</id>
+ <published>2007-05-30T00:23:27.006Z</published>
+ <updated>2007-05-17T10:12:36.000Z</updated>
+ <title type="text">Sample Calendar D</title>
+ <summary type="text"/>
+ <link rel="alternate" type="application/atom+xml" href="http://www.google.com/calendar/feeds/u4u5cksnpp1vufdarpupn5um5s%40group.calendar.google.com/private/full"/>
+ <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml" href="http://www.google.com/calendar/feeds/u4u5cksnpp1vufdarpupn5um5s%40group.calendar.google.com/acl/full"/>
+ <link rel="self" type="application/atom+xml" href="http://www.google.com/calendar/feeds/default/u4u5cksnpp1vufdarpupn5um5s%40group.calendar.google.com"/>
+ <author>
+ <name>GData Ops Demo</name>
+ <email>gdata.ops.demo@gmail.com</email>
+ </author>
+ <gCal:timezone value="America/Los_Angeles"/>
+ <gCal:hidden value="false"/>
+ <gCal:color value="#528800"/>
+ <gCal:selected value="false"/>
+ <gCal:accesslevel value="owner"/>
+ <gd:where valueString=""/>
+ </entry>
+ <entry>
+ <id>http://www.google.com/calendar/feeds/default/ibdlf33v6fj62rgfucib6s181s%40group.calendar.google.com</id>
+ <published>2007-05-30T00:23:27.006Z</published>
+ <updated>2007-05-17T10:52:01.000Z</updated>
+ <title type="text">Sample Calender E</title>
+ <summary type="text"/>
+ <link rel="alternate" type="application/atom+xml" href="http://www.google.com/calendar/feeds/ibdlf33v6fj62rgfucib6s181s%40group.calendar.google.com/private/full"/>
+ <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml" href="http://www.google.com/calendar/feeds/ibdlf33v6fj62rgfucib6s181s%40group.calendar.google.com/acl/full"/>
+ <link rel="self" type="application/atom+xml" href="http://www.google.com/calendar/feeds/default/ibdlf33v6fj62rgfucib6s181s%40group.calendar.google.com"/>
+ <author>
+ <name>GData Ops Demo</name>
+ <email>gdata.ops.demo@gmail.com</email>
+ </author>
+ <gCal:timezone value="America/Chicago"/>
+ <gCal:hidden value="false"/>
+ <gCal:color value="#5A6986"/>
+ <gCal:selected value="false"/>
+ <gCal:accesslevel value="owner"/>
+ <gd:where valueString=""/>
+ </entry>
+ <entry>
+ <id>http://www.google.com/calendar/feeds/default/usa__en%40holiday.calendar.google.com</id>
+ <published>2007-05-30T00:23:27.006Z</published>
+ <updated>2007-05-17T09:48:29.000Z</updated>
+ <title type="text">US Holidays</title>
+ <link rel="alternate" type="application/atom+xml" href="http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/private/full"/>
+ <link rel="self" type="application/atom+xml" href="http://www.google.com/calendar/feeds/default/usa__en%40holiday.calendar.google.com"/>
+ <author>
+ <name>GData Ops Demo</name>
+ <email>gdata.ops.demo@gmail.com</email>
+ </author>
+ <gCal:timezone value="America/Los_Angeles"/>
+ <gCal:hidden value="false"/>
+ <gCal:color value="#5A6986"/>
+ <gCal:selected value="false"/>
+ <gCal:accesslevel value="read"/>
+ </entry>
+ <entry>
+ <id>http://www.google.com/calendar/feeds/default/7u5mocvk4et2vgtjte1dtcff2o%40group.calendar.google.com</id>
+ <published>2007-05-30T00:23:27.005Z</published>
+ <updated>2007-05-30T00:20:02.000Z</updated>
+ <title type="text">My Awesome Calendar</title>
+ <summary type="text">This is my awesome calendar</summary>
+ <link rel="alternate" type="application/atom+xml" href="http://www.google.com/calendar/feeds/7u5mocvk4et2vgtjte1dtcff2o%40group.calendar.google.com/private/full"/>
+ <link rel="http://schemas.google.com/acl/2007#accessControlList" type="application/atom+xml" href="http://www.google.com/calendar/feeds/7u5mocvk4et2vgtjte1dtcff2o%40group.calendar.google.com/acl/full"/>
+ <link rel="self" type="application/atom+xml" href="http://www.google.com/calendar/feeds/default/7u5mocvk4et2vgtjte1dtcff2o%40group.calendar.google.com"/>
+ <author>
+ <name>GData Ops Demo</name>
+ <email>gdata.ops.demo@gmail.com</email>
+ </author>
+ <gCal:timezone value="America/Los_Angeles"/>
+ <gCal:hidden value="false"/>
+ <gCal:color value="#5A6986"/>
+ <gCal:selected value="false"/>
+ <gCal:accesslevel value="owner"/>
+ <gd:where valueString="Mountain View, California"/>
+ </entry>
+</feed>
+
diff --git a/zend/tests/Zend/Gdata/Calendar/_files/QuickAddElementSample1.xml b/zend/tests/Zend/Gdata/Calendar/_files/QuickAddElementSample1.xml new file mode 100644 index 0000000..2eaa496 --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/_files/QuickAddElementSample1.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" ?> +<quickadd xmlns="http://schemas.google.com/gCal/2005" value="true"/> diff --git a/zend/tests/Zend/Gdata/Calendar/_files/SelectedElementSample1.xml b/zend/tests/Zend/Gdata/Calendar/_files/SelectedElementSample1.xml new file mode 100644 index 0000000..8f8179c --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/_files/SelectedElementSample1.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" ?> +<selected xmlns="http://schemas.google.com/gCal/2005" value="false"/> diff --git a/zend/tests/Zend/Gdata/Calendar/_files/SendEventNotificationsElementSample1.xml b/zend/tests/Zend/Gdata/Calendar/_files/SendEventNotificationsElementSample1.xml new file mode 100644 index 0000000..3173035 --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/_files/SendEventNotificationsElementSample1.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" ?> +<sendEventNotifications xmlns="http://schemas.google.com/gCal/2005" value="false"/> diff --git a/zend/tests/Zend/Gdata/Calendar/_files/TestDataEventFeedSample1.xml b/zend/tests/Zend/Gdata/Calendar/_files/TestDataEventFeedSample1.xml new file mode 100644 index 0000000..08bb95a --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/_files/TestDataEventFeedSample1.xml @@ -0,0 +1,460 @@ +<?xml version='1.0' encoding='utf-8'?> +<feed xmlns='http://www.w3.org/2005/Atom' +xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' +xmlns:gd='http://schemas.google.com/g/2005' +xmlns:gCal='http://schemas.google.com/gCal/2005'> + <id> + http://www.google.com/calendar/feeds/default/private/full</id> + <updated>2007-03-20T21:29:57.000Z</updated> + <category scheme='http://schemas.google.com/g/2005#kind' + term='http://schemas.google.com/g/2005#event'></category> + <title type='text'>GData Ops Demo</title> + <subtitle type='text'>Demo Feed</subtitle> + <link rel='http://schemas.google.com/g/2005#feed' + type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full'> + </link> + <link rel='http://schemas.google.com/g/2005#post' + type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full'> + </link> + <link rel='self' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full?updated-min=2001-01-01&max-results=25'> + </link> + <author> + <name>GData Ops Demo</name> + <email>gdata.ops.demo@gmail.com</email> + <uri>http://test.address.invalid/</uri> + </author> + <generator version='1.0' uri='http://www.google.com/calendar'> + Google Calendar</generator> + <openSearch:totalResults>10</openSearch:totalResults> + <openSearch:startIndex>1</openSearch:startIndex> + <openSearch:itemsPerPage>25</openSearch:itemsPerPage> + <gCal:timezone value='America/Los_Angeles'></gCal:timezone> + <entry> + <id> + http://www.google.com/calendar/feeds/default/private/full/o99flmgmkfkfrr8u745ghr3100</id> + <published>2007-03-20T21:29:52.000Z</published> + <updated>2007-03-20T21:29:57.000Z</updated> + <category scheme='http://schemas.google.com/g/2005#kind' + term='http://schemas.google.com/g/2005#event'></category> + <title type='text'>test deleted</title> + <content type='text'></content> + <link rel='alternate' type='text/html' + href='http://www.google.com/calendar/event?eid=bzk5ZmxtZ21rZmtmcnI4dTc0NWdocjMxMDAgZ2RhdGEub3BzLmRlbW9AbQ' + title='alternate'></link> + <link rel='self' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full/o99flmgmkfkfrr8u745ghr3100'> + </link> + <link rel='edit' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full/o99flmgmkfkfrr8u745ghr3100/63310109397'> + </link> + <author> + <name>GData Ops Demo</name> + <email>gdata.ops.demo@gmail.com</email> + </author> + <gCal:sendEventNotifications value='false'> + </gCal:sendEventNotifications> + <gd:eventStatus value='http://schemas.google.com/g/2005#event.canceled'> + </gd:eventStatus> + <gd:comments> + <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/o99flmgmkfkfrr8u745ghr3100/comments'> + </gd:feedLink> + </gd:comments> + <gd:visibility value='http://schemas.google.com/g/2005#event.default'> + </gd:visibility> + <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> + </gd:transparency> + <gd:when startTime='2007-03-23T12:00:00.000-07:00' + endTime='2007-03-23T13:00:00.000-07:00'> + <gd:reminder minutes='10'></gd:reminder> + </gd:when> + <gd:where></gd:where> + </entry> + <entry> + <id> + http://www.google.com/calendar/feeds/default/private/full/2qt3ao5hbaq7m9igr5ak9esjo0</id> + <published>2007-03-20T21:26:04.000Z</published> + <updated>2007-03-20T21:28:46.000Z</updated> + <category scheme='http://schemas.google.com/g/2005#kind' + term='http://schemas.google.com/g/2005#event'></category> + <title type='text'>Afternoon at Dolores Park with Kim</title> + <content type='text'>This will be fun.</content> + <link rel='alternate' type='text/html' + href='http://www.google.com/calendar/event?eid=MnF0M2FvNWhiYXE3bTlpZ3I1YWs5ZXNqbzAgZ2RhdGEub3BzLmRlbW9AbQ' + title='alternate'></link> + <link rel='self' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full/2qt3ao5hbaq7m9igr5ak9esjo0'> + </link> + <link rel='edit' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full/2qt3ao5hbaq7m9igr5ak9esjo0/63310109326'> + </link> + <author> + <name>GData Ops Demo</name> + <email>gdata.ops.demo@gmail.com</email> + </author> + <gCal:sendEventNotifications value='false'> + </gCal:sendEventNotifications> + <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'> + </gd:eventStatus> + <gd:comments> + <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/2qt3ao5hbaq7m9igr5ak9esjo0/comments'> + </gd:feedLink> + </gd:comments> + <gd:visibility value='http://schemas.google.com/g/2005#event.private'> + </gd:visibility> + <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> + </gd:transparency> + <gd:who rel='http://schemas.google.com/g/2005#event.organizer' + valueString='GData Ops Demo' email='gdata.ops.demo@gmail.com'> + <gd:attendeeStatus value='http://schemas.google.com/g/2005#event.accepted'> + </gd:attendeeStatus> + </gd:who> + <gd:who rel='http://schemas.google.com/g/2005#event.attendee' + valueString='Ryan Boyd (API)' email='api.rboyd@gmail.com'> + <gd:attendeeStatus value='http://schemas.google.com/g/2005#event.invited'> + </gd:attendeeStatus> + </gd:who> + <gd:when startTime='2007-03-24T12:00:00.000-07:00' + endTime='2007-03-24T15:00:00.000-07:00'> + <gd:reminder minutes='20' method="alert"></gd:reminder> + </gd:when> + <gd:where valueString='Dolores Park with Kim'></gd:where> + <gCal:quickadd value="true" /> + </entry> + <entry> + <id> + http://www.google.com/calendar/feeds/default/private/full/uvsqhg7klnae40v50vihr1pvos</id> + <published>2007-03-20T21:28:37.000Z</published> + <updated>2007-03-20T21:28:37.000Z</updated> + <category scheme='http://schemas.google.com/g/2005#kind' + term='http://schemas.google.com/g/2005#event'></category> + <title type='text'>Team meeting</title> + <content type='text'></content> + <link rel='alternate' type='text/html' + href='http://www.google.com/calendar/event?eid=dXZzcWhnN2tsbmFlNDB2NTB2aWhyMXB2b3NfMjAwNzAzMjNUMTYwMDAwWiBnZGF0YS5vcHMuZGVtb0Bt' + title='alternate'></link> + <link rel='self' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full/uvsqhg7klnae40v50vihr1pvos'> + </link> + <link rel='edit' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full/uvsqhg7klnae40v50vihr1pvos/63310109317'> + </link> + <author> + <name>GData Ops Demo</name> + <email>gdata.ops.demo@gmail.com</email> + </author> + <gd:recurrence>DTSTART;TZID=America/Los_Angeles:20070323T090000 + DTEND;TZID=America/Los_Angeles:20070323T100000 + RRULE:FREQ=WEEKLY;BYDAY=FR;UNTIL=20070817T160000Z;WKST=SU + BEGIN:VTIMEZONE TZID:America/Los_Angeles + X-LIC-LOCATION:America/Los_Angeles BEGIN:STANDARD + TZOFFSETFROM:-0700 TZOFFSETTO:-0800 TZNAME:PST + DTSTART:19701025T020000 RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU + END:STANDARD BEGIN:DAYLIGHT TZOFFSETFROM:-0800 TZOFFSETTO:-0700 + TZNAME:PDT DTSTART:19700405T020000 + RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=1SU END:DAYLIGHT + END:VTIMEZONE</gd:recurrence> + <gCal:sendEventNotifications value='true'> + </gCal:sendEventNotifications> + <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'> + </gd:eventStatus> + <gd:visibility value='http://schemas.google.com/g/2005#event.public'> + </gd:visibility> + <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> + </gd:transparency> + <gd:reminder minutes='10'></gd:reminder> + <gd:where valueString=''></gd:where> + </entry> + <entry> + <id> + http://www.google.com/calendar/feeds/default/private/full/st4vk9kiffs6rasrl32e4a7alo</id> + <published>2007-03-20T21:25:46.000Z</published> + <updated>2007-03-20T21:25:46.000Z</updated> + <category scheme='http://schemas.google.com/g/2005#kind' + term='http://schemas.google.com/g/2005#event'></category> + <title type='text'>Movie with Kim and danah</title> + <content type='text'></content> + <link rel='alternate' type='text/html' + href='http://www.google.com/calendar/event?eid=c3Q0dms5a2lmZnM2cmFzcmwzMmU0YTdhbG8gZ2RhdGEub3BzLmRlbW9AbQ' + title='alternate'></link> + <link rel='self' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full/st4vk9kiffs6rasrl32e4a7alo'> + </link> + <link rel='edit' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full/st4vk9kiffs6rasrl32e4a7alo/63310109146'> + </link> + <author> + <name>GData Ops Demo</name> + <email>gdata.ops.demo@gmail.com</email> + </author> + <gCal:sendEventNotifications value='false'> + </gCal:sendEventNotifications> + <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'> + </gd:eventStatus> + <gd:comments> + <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/st4vk9kiffs6rasrl32e4a7alo/comments'> + </gd:feedLink> + </gd:comments> + <gd:visibility value='http://schemas.google.com/g/2005#event.default'> + </gd:visibility> + <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> + </gd:transparency> + <gd:when startTime='2007-03-24T20:00:00.000-07:00' + endTime='2007-03-24T21:00:00.000-07:00'> + <gd:reminder minutes='10'></gd:reminder> + </gd:when> + <gd:where></gd:where> + </entry> + <entry> + <id> + http://www.google.com/calendar/feeds/default/private/full/ofl1e45ubtsoh6gtu127cls2oo</id> + <published>2007-03-20T21:24:43.000Z</published> + <updated>2007-03-20T21:25:08.000Z</updated> + <category scheme='http://schemas.google.com/g/2005#kind' + term='http://schemas.google.com/g/2005#event'></category> + <title type='text'>Dinner with Kim and Sarah</title> + <content type='text'></content> + <link rel='alternate' type='text/html' + href='http://www.google.com/calendar/event?eid=b2ZsMWU0NXVidHNvaDZndHUxMjdjbHMyb28gZ2RhdGEub3BzLmRlbW9AbQ' + title='alternate'></link> + <link rel='self' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full/ofl1e45ubtsoh6gtu127cls2oo'> + </link> + <link rel='edit' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full/ofl1e45ubtsoh6gtu127cls2oo/63310109108'> + </link> + <author> + <name>GData Ops Demo</name> + <email>gdata.ops.demo@gmail.com</email> + </author> + <gCal:sendEventNotifications value='false'> + </gCal:sendEventNotifications> + <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'> + </gd:eventStatus> + <gd:comments> + <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/ofl1e45ubtsoh6gtu127cls2oo/comments'> + </gd:feedLink> + </gd:comments> + <gd:visibility value='http://schemas.google.com/g/2005#event.default'> + </gd:visibility> + <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> + </gd:transparency> + <gd:when startTime='2007-03-20T19:00:00.000-07:00' + endTime='2007-03-20T21:30:00.000-07:00'> + <gd:reminder minutes='10'></gd:reminder> + </gd:when> + <gd:where></gd:where> + </entry> + <entry> + <id> + http://www.google.com/calendar/feeds/default/private/full/b69s2avfi2joigsclecvjlc91g</id> + <published>2007-03-20T21:24:19.000Z</published> + <updated>2007-03-20T21:25:05.000Z</updated> + <category scheme='http://schemas.google.com/g/2005#kind' + term='http://schemas.google.com/g/2005#event'></category> + <title type='text'>Dinner with Jane and John</title> + <content type='text'></content> + <link rel='alternate' type='text/html' + href='http://www.google.com/calendar/event?eid=YjY5czJhdmZpMmpvaWdzY2xlY3ZqbGM5MWcgZ2RhdGEub3BzLmRlbW9AbQ' + title='alternate'></link> + <link rel='self' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full/b69s2avfi2joigsclecvjlc91g'> + </link> + <link rel='edit' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full/b69s2avfi2joigsclecvjlc91g/63310109105'> + </link> + <author> + <name>GData Ops Demo</name> + <email>gdata.ops.demo@gmail.com</email> + </author> + <gCal:sendEventNotifications value='false'> + </gCal:sendEventNotifications> + <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'> + </gd:eventStatus> + <gd:comments> + <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/b69s2avfi2joigsclecvjlc91g/comments'> + </gd:feedLink> + </gd:comments> + <gd:visibility value='http://schemas.google.com/g/2005#event.default'> + </gd:visibility> + <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> + </gd:transparency> + <gd:when startTime='2007-03-22T17:00:00.000-07:00' + endTime='2007-03-22T19:30:00.000-07:00'> + <gd:reminder minutes='10'></gd:reminder> + </gd:when> + <gd:where></gd:where> + </entry> + <entry> + <id> + http://www.google.com/calendar/feeds/default/private/full/u9p66kkiotn8bqh9k7j4rcnjjc</id> + <published>2007-03-20T21:24:33.000Z</published> + <updated>2007-03-20T21:24:33.000Z</updated> + <category scheme='http://schemas.google.com/g/2005#kind' + term='http://schemas.google.com/g/2005#event'></category> + <title type='text'>Tennis with Elizabeth</title> + <content type='text'></content> + <link rel='alternate' type='text/html' + href='http://www.google.com/calendar/event?eid=dTlwNjZra2lvdG44YnFoOWs3ajRyY25qamMgZ2RhdGEub3BzLmRlbW9AbQ' + title='alternate'></link> + <link rel='self' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full/u9p66kkiotn8bqh9k7j4rcnjjc'> + </link> + <link rel='edit' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full/u9p66kkiotn8bqh9k7j4rcnjjc/63310109073'> + </link> + <author> + <name>GData Ops Demo</name> + <email>gdata.ops.demo@gmail.com</email> + </author> + <gCal:sendEventNotifications value='false'> + </gCal:sendEventNotifications> + <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'> + </gd:eventStatus> + <gd:comments> + <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/u9p66kkiotn8bqh9k7j4rcnjjc/comments'> + </gd:feedLink> + </gd:comments> + <gd:visibility value='http://schemas.google.com/g/2005#event.default'> + </gd:visibility> + <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> + </gd:transparency> + <gd:when startTime='2007-03-24T10:00:00.000-07:00' + endTime='2007-03-24T11:00:00.000-07:00'> + <gd:reminder minutes='10'></gd:reminder> + </gd:when> + <gd:where></gd:where> + </entry> + <entry> + <id> + http://www.google.com/calendar/feeds/default/private/full/76oj2kceidob3s708tvfnuaq3c</id> + <published>2007-03-20T21:24:00.000Z</published> + <updated>2007-03-20T21:24:00.000Z</updated> + <category scheme='http://schemas.google.com/g/2005#kind' + term='http://schemas.google.com/g/2005#event'></category> + <title type='text'>Lunch with Jenn</title> + <content type='text'></content> + <link rel='alternate' type='text/html' + href='http://www.google.com/calendar/event?eid=NzZvajJrY2VpZG9iM3M3MDh0dmZudWFxM2MgZ2RhdGEub3BzLmRlbW9AbQ' + title='alternate'></link> + <link rel='self' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full/76oj2kceidob3s708tvfnuaq3c'> + </link> + <link rel='edit' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full/76oj2kceidob3s708tvfnuaq3c/63310109040'> + </link> + <author> + <name>GData Ops Demo</name> + <email>gdata.ops.demo@gmail.com</email> + </author> + <gCal:sendEventNotifications value='false'> + </gCal:sendEventNotifications> + <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'> + </gd:eventStatus> + <gd:comments> + <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/76oj2kceidob3s708tvfnuaq3c/comments'> + </gd:feedLink> + </gd:comments> + <gd:visibility value='http://schemas.google.com/g/2005#event.default'> + </gd:visibility> + <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> + </gd:transparency> + <gd:when startTime='2007-03-20T11:30:00.000-07:00' + endTime='2007-03-20T12:30:00.000-07:00'> + <gd:reminder minutes='10'></gd:reminder> + </gd:when> + <gd:where></gd:where> + </entry> + <entry> + <id> + http://www.google.com/calendar/feeds/default/private/full/5np9ec8m7uoauk1vedh5mhodco</id> + <published>2007-03-20T07:50:02.000Z</published> + <updated>2007-03-20T20:39:26.000Z</updated> + <category scheme='http://schemas.google.com/g/2005#kind' + term='http://schemas.google.com/g/2005#event'></category> + <title type='text'>test entry</title> + <content type='text'>test desc</content> + <link rel='alternate' type='text/html' + href='http://www.google.com/calendar/event?eid=NW5wOWVjOG03dW9hdWsxdmVkaDVtaG9kY28gZ2RhdGEub3BzLmRlbW9AbQ' + title='alternate'></link> + <link rel='self' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full/5np9ec8m7uoauk1vedh5mhodco'> + </link> + <link rel='edit' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full/5np9ec8m7uoauk1vedh5mhodco/63310106366'> + </link> + <author> + <name>GData Ops Demo</name> + <email>gdata.ops.demo@gmail.com</email> + </author> + <gCal:sendEventNotifications value='false'> + </gCal:sendEventNotifications> + <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'> + </gd:eventStatus> + <gd:comments> + <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/5np9ec8m7uoauk1vedh5mhodco/comments'> + </gd:feedLink> + </gd:comments> + <gd:visibility value='http://schemas.google.com/g/2005#event.private'> + </gd:visibility> + <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> + </gd:transparency> + <gd:who rel='http://schemas.google.com/g/2005#event.attendee' + valueString='Vivian Li' email='vli@google.com'> + <gd:attendeeStatus value='http://schemas.google.com/g/2005#event.declined'> + </gd:attendeeStatus> + </gd:who> + <gd:who rel='http://schemas.google.com/g/2005#event.organizer' + valueString='GData Ops Demo' email='gdata.ops.demo@gmail.com'> + <gd:attendeeStatus value='http://schemas.google.com/g/2005#event.accepted'> + </gd:attendeeStatus> + </gd:who> + <gd:when startTime='2007-03-21T08:00:00.000-07:00' + endTime='2007-03-21T09:00:00.000-07:00'> + <gd:reminder minutes='10'></gd:reminder> + </gd:when> + <gd:where valueString='anywhere'></gd:where> + </entry> + <entry> + <id> + http://www.google.com/calendar/feeds/default/private/full/fu6sl0rqakf3o0a13oo1i1a1mg</id> + <published>2007-02-14T23:23:37.000Z</published> + <updated>2007-02-14T23:25:30.000Z</updated> + <category scheme='http://schemas.google.com/g/2005#kind' + term='http://schemas.google.com/g/2005#event'></category> + <title type='text'>test</title> + <content type='text'></content> + <link rel='alternate' type='text/html' + href='http://www.google.com/calendar/event?eid=ZnU2c2wwcnFha2YzbzBhMTNvbzFpMWExbWcgZ2RhdGEub3BzLmRlbW9AbQ' + title='alternate'></link> + <link rel='self' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full/fu6sl0rqakf3o0a13oo1i1a1mg'> + </link> + <link rel='edit' type='application/atom+xml' + href='http://www.google.com/calendar/feeds/default/private/full/fu6sl0rqakf3o0a13oo1i1a1mg/63307178730'> + </link> + <author> + <name>GData Ops Demo</name> + <email>gdata.ops.demo@gmail.com</email> + </author> + <gCal:sendEventNotifications value='false'> + </gCal:sendEventNotifications> + <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'> + </gd:eventStatus> + <gd:comments> + <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/fu6sl0rqakf3o0a13oo1i1a1mg/comments'> + </gd:feedLink> + </gd:comments> + <gd:visibility value='http://schemas.google.com/g/2005#event.default'> + </gd:visibility> + <gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> + </gd:transparency> + <gd:when startTime='2007-02-15T08:30:00.000-08:00' + endTime='2007-02-15T09:30:00.000-08:00'> + <gd:reminder minutes='10'></gd:reminder> + </gd:when> + <gd:where></gd:where> + </entry> +</feed> diff --git a/zend/tests/Zend/Gdata/Calendar/_files/TimezoneElementSample1.xml b/zend/tests/Zend/Gdata/Calendar/_files/TimezoneElementSample1.xml new file mode 100644 index 0000000..f0792d6 --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/_files/TimezoneElementSample1.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" ?> +<timezone xmlns="http://schemas.google.com/gCal/2005" value="America/Los_Angeles"/> diff --git a/zend/tests/Zend/Gdata/Calendar/_files/WebContentElementSample1.xml b/zend/tests/Zend/Gdata/Calendar/_files/WebContentElementSample1.xml new file mode 100644 index 0000000..bea486d --- /dev/null +++ b/zend/tests/Zend/Gdata/Calendar/_files/WebContentElementSample1.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" ?> +<gCal:webContent xmlns:gCal="http://schemas.google.com/gCal/2005" + url="http://www.google.com/logos/july4th06.gif" + width="276" height="120" /> |
