Beispiel #1
0
 public function testNormalWhereShouldHaveNoExtensionElements()
 {
     $this->where->valueString = "Test Value String";
     $this->where->rel = "http://schemas.google.com/g/2005#event.alternate";
     $this->where->label = "Test Label";
     $this->assertEquals("Test Value String", $this->where->valueString);
     $this->assertEquals("http://schemas.google.com/g/2005#event.alternate", $this->where->rel);
     $this->assertEquals("Test Label", $this->where->label);
     $this->assertEquals(0, count($this->where->extensionElements));
     $newWhere = new Extension\Where();
     $newWhere->transferFromXML($this->where->saveXML());
     $this->assertEquals(0, count($newWhere->extensionElements));
     $newWhere->extensionElements = array(new \Zend\GData\App\Extension\Element('foo', 'atom', null, 'bar'));
     $this->assertEquals(1, count($newWhere->extensionElements));
     $this->assertEquals("Test Value String", $newWhere->valueString);
     $this->assertEquals("http://schemas.google.com/g/2005#event.alternate", $newWhere->rel);
     $this->assertEquals("Test Label", $newWhere->label);
     /* try constructing using magic factory */
     $gdata = new \Zend\GData\GData();
     $newWhere2 = $gdata->newWhere();
     $newWhere2->transferFromXML($newWhere->saveXML());
     $this->assertEquals(1, count($newWhere2->extensionElements));
     $this->assertEquals("Test Value String", $newWhere2->valueString);
     $this->assertEquals("http://schemas.google.com/g/2005#event.alternate", $newWhere2->rel);
     $this->assertEquals("Test Label", $newWhere2->label);
 }
Beispiel #2
0
 public function testNormalEntryLinkShouldHaveNoExtensionElements()
 {
     $this->entryLink->href = "http://gmail.com/jo/contacts/Bob";
     $this->entryLink->rel = "self";
     $this->entryLink->readOnly = "false";
     $this->assertEquals("http://gmail.com/jo/contacts/Bob", $this->entryLink->href);
     $this->assertEquals("self", $this->entryLink->rel);
     $this->assertEquals("false", $this->entryLink->readOnly);
     $this->assertEquals(0, count($this->entryLink->extensionElements));
     $newEntryLink = new Extension\EntryLink();
     $newEntryLink->transferFromXML($this->entryLink->saveXML());
     $this->assertEquals(0, count($newEntryLink->extensionElements));
     $newEntryLink->extensionElements = array(new \Zend\GData\App\Extension\Element('foo', 'atom', null, 'bar'));
     $this->assertEquals(1, count($newEntryLink->extensionElements));
     $this->assertEquals("http://gmail.com/jo/contacts/Bob", $newEntryLink->href);
     $this->assertEquals("self", $newEntryLink->rel);
     $this->assertEquals("false", $newEntryLink->readOnly);
     /* try constructing using magic factory */
     $gdata = new \Zend\GData\GData();
     $newEntryLink2 = $gdata->newEntryLink();
     $newEntryLink2->transferFromXML($newEntryLink->saveXML());
     $this->assertEquals(1, count($newEntryLink2->extensionElements));
     $this->assertEquals("http://gmail.com/jo/contacts/Bob", $newEntryLink2->href);
     $this->assertEquals("self", $newEntryLink2->rel);
     $this->assertEquals("false", $newEntryLink2->readOnly);
 }
Beispiel #3
0
 public function testNormalWhenShouldHaveNoExtensionElements()
 {
     $this->when->valueString = "Later";
     $this->when->endTime = "2007-06-21T21:31:56-07:00";
     $this->when->startTime = "2007-06-19T05:42:19-06:00";
     $this->assertEquals("Later", $this->when->valueString);
     $this->assertEquals("2007-06-21T21:31:56-07:00", $this->when->endTime);
     $this->assertEquals("2007-06-19T05:42:19-06:00", $this->when->startTime);
     $this->assertEquals(0, count($this->when->extensionElements));
     $newWhen = new Extension\When();
     $newWhen->transferFromXML($this->when->saveXML());
     $this->assertEquals(0, count($newWhen->extensionElements));
     $newWhen->extensionElements = array(new \Zend\GData\App\Extension\Element('foo', 'atom', null, 'bar'));
     $this->assertEquals(1, count($newWhen->extensionElements));
     $this->assertEquals("Later", $newWhen->valueString);
     $this->assertEquals("2007-06-21T21:31:56-07:00", $newWhen->endTime);
     $this->assertEquals("2007-06-19T05:42:19-06:00", $newWhen->startTime);
     /* try constructing using magic factory */
     $gdata = new \Zend\GData\GData();
     $newWhen2 = $gdata->newWhen();
     $newWhen2->transferFromXML($newWhen->saveXML());
     $this->assertEquals(1, count($newWhen2->extensionElements));
     $this->assertEquals("Later", $newWhen2->valueString);
     $this->assertEquals("2007-06-21T21:31:56-07:00", $newWhen2->endTime);
     $this->assertEquals("2007-06-19T05:42:19-06:00", $newWhen2->startTime);
 }
Beispiel #4
0
 public function testNormalWhoShouldHaveNoExtensionElements()
 {
     $this->who->valueString = "Test Value String";
     $this->who->rel = "http://schemas.google.com/g/2005#event.speaker";
     $this->who->email = "*****@*****.**";
     $this->assertEquals("Test Value String", $this->who->valueString);
     $this->assertEquals("http://schemas.google.com/g/2005#event.speaker", $this->who->rel);
     $this->assertEquals("*****@*****.**", $this->who->email);
     $this->assertEquals(0, count($this->who->extensionElements));
     $newWho = new Extension\Who();
     $newWho->transferFromXML($this->who->saveXML());
     $this->assertEquals(0, count($newWho->extensionElements));
     $newWho->extensionElements = array(new \Zend\GData\App\Extension\Element('foo', 'atom', null, 'bar'));
     $this->assertEquals(1, count($newWho->extensionElements));
     $this->assertEquals("Test Value String", $newWho->valueString);
     $this->assertEquals("http://schemas.google.com/g/2005#event.speaker", $newWho->rel);
     $this->assertEquals("*****@*****.**", $newWho->email);
     /* try constructing using magic factory */
     $gdata = new \Zend\GData\GData();
     $newWho2 = $gdata->newWho();
     $newWho2->transferFromXML($newWho->saveXML());
     $this->assertEquals(1, count($newWho2->extensionElements));
     $this->assertEquals("Test Value String", $newWho2->valueString);
     $this->assertEquals("http://schemas.google.com/g/2005#event.speaker", $newWho2->rel);
     $this->assertEquals("*****@*****.**", $newWho2->email);
 }
Beispiel #5
0
 public function testNormalReminderShouldHaveNoExtensionElements()
 {
     $this->reminder->days = "12";
     $this->reminder->minutes = "64";
     $this->reminder->absoluteTime = "2007-06-19T12:42:19-06:00";
     $this->reminder->method = "email";
     $this->reminder->hours = "80";
     $this->assertEquals("12", $this->reminder->days);
     $this->assertEquals("64", $this->reminder->minutes);
     $this->assertEquals("2007-06-19T12:42:19-06:00", $this->reminder->absoluteTime);
     $this->assertEquals("email", $this->reminder->method);
     $this->assertEquals("80", $this->reminder->hours);
     $this->assertEquals(0, count($this->reminder->extensionElements));
     $newReminder = new Extension\Reminder();
     $newReminder->transferFromXML($this->reminder->saveXML());
     $this->assertEquals(0, count($newReminder->extensionElements));
     $newReminder->extensionElements = array(new \Zend\GData\App\Extension\Element('foo', 'atom', null, 'bar'));
     $this->assertEquals(1, count($newReminder->extensionElements));
     $this->assertEquals("12", $newReminder->days);
     $this->assertEquals("64", $newReminder->minutes);
     $this->assertEquals("2007-06-19T12:42:19-06:00", $newReminder->absoluteTime);
     $this->assertEquals("email", $newReminder->method);
     $this->assertEquals("80", $newReminder->hours);
     /* try constructing using magic factory */
     $gdata = new \Zend\GData\GData();
     $newReminder2 = $gdata->newReminder();
     $newReminder2->transferFromXML($newReminder->saveXML());
     $this->assertEquals(1, count($newReminder2->extensionElements));
     $this->assertEquals("12", $newReminder2->days);
     $this->assertEquals("64", $newReminder2->minutes);
     $this->assertEquals("2007-06-19T12:42:19-06:00", $newReminder2->absoluteTime);
     $this->assertEquals("email", $newReminder2->method);
     $this->assertEquals("80", $newReminder2->hours);
 }
Beispiel #6
0
 public function testNormalFeedLinkShouldHaveNoExtensionElements()
 {
     $this->feedLink->href = "http://www.google.com/calendar/feeds/default/private/full";
     $this->feedLink->rel = "via";
     $this->feedLink->countHint = "5";
     $this->feedLink->readOnly = "false";
     $this->assertEquals("http://www.google.com/calendar/feeds/default/private/full", $this->feedLink->href);
     $this->assertEquals("via", $this->feedLink->rel);
     $this->assertEquals("5", $this->feedLink->countHint);
     $this->assertEquals("false", $this->feedLink->readOnly);
     $this->assertEquals(0, count($this->feedLink->extensionElements));
     $newFeedLink = new Extension\FeedLink();
     $newFeedLink->transferFromXML($this->feedLink->saveXML());
     $this->assertEquals(0, count($newFeedLink->extensionElements));
     $newFeedLink->extensionElements = array(new \Zend\GData\App\Extension\Element('foo', 'atom', null, 'bar'));
     $this->assertEquals(1, count($newFeedLink->extensionElements));
     $this->assertEquals("http://www.google.com/calendar/feeds/default/private/full", $newFeedLink->href);
     $this->assertEquals("via", $newFeedLink->rel);
     $this->assertEquals("5", $newFeedLink->countHint);
     $this->assertEquals("false", $newFeedLink->readOnly);
     /* try constructing using magic factory */
     $gdata = new \Zend\GData\GData();
     $newFeedLink2 = $gdata->newFeedLink();
     $newFeedLink2->transferFromXML($newFeedLink->saveXML());
     $this->assertEquals(1, count($newFeedLink2->extensionElements));
     $this->assertEquals("http://www.google.com/calendar/feeds/default/private/full", $newFeedLink2->href);
     $this->assertEquals("via", $newFeedLink2->rel);
     $this->assertEquals("5", $newFeedLink2->countHint);
     $this->assertEquals("false", $newFeedLink2->readOnly);
 }
    public function testNormalExtendedPropertyShouldHaveNoExtensionElements() {
        $this->extendedProperty->name = "http://www.example.com/schemas/2007#mycal.foo";
        $this->extendedProperty->value = "5678";

        $this->assertEquals("http://www.example.com/schemas/2007#mycal.foo", $this->extendedProperty->name);
        $this->assertEquals("5678", $this->extendedProperty->value);

        $this->assertEquals(0, count($this->extendedProperty->extensionElements));
        $newExtendedProperty = new Extension\ExtendedProperty();
        $newExtendedProperty->transferFromXML($this->extendedProperty->saveXML());
        $this->assertEquals(0, count($newExtendedProperty->extensionElements));
        $newExtendedProperty->extensionElements = array(
                new \Zend\GData\App\Extension\Element('foo', 'atom', null, 'bar'));
        $this->assertEquals(1, count($newExtendedProperty->extensionElements));
        $this->assertEquals("http://www.example.com/schemas/2007#mycal.foo", $newExtendedProperty->name);
        $this->assertEquals("5678", $newExtendedProperty->value);

        /* try constructing using magic factory */
        $gdata = new \Zend\GData\GData();
        $newExtendedProperty2 = $gdata->newExtendedProperty();
        $newExtendedProperty2->transferFromXML($newExtendedProperty->saveXML());
        $this->assertEquals(1, count($newExtendedProperty2->extensionElements));
        $this->assertEquals("http://www.example.com/schemas/2007#mycal.foo", $newExtendedProperty2->name);
        $this->assertEquals("5678", $newExtendedProperty2->value);
    }
    public function testNormalOriginalEventShouldHaveNoExtensionElements() {
        $this->originalEvent->href = "http://www.google.com/calendar/feeds/nobody@gmail.com/private/composite";
        $this->originalEvent->id = "abcdef123456789";

        $this->assertEquals("http://www.google.com/calendar/feeds/nobody@gmail.com/private/composite", $this->originalEvent->href);
        $this->assertEquals("abcdef123456789", $this->originalEvent->id);

        $this->assertEquals(0, count($this->originalEvent->extensionElements));
        $newOriginalEvent = new Extension\OriginalEvent();
        $newOriginalEvent->transferFromXML($this->originalEvent->saveXML());
        $this->assertEquals(0, count($newOriginalEvent->extensionElements));
        $newOriginalEvent->extensionElements = array(
                new \Zend\GData\App\Extension\Element('foo', 'atom', null, 'bar'));
        $this->assertEquals(1, count($newOriginalEvent->extensionElements));
        $this->assertEquals("http://www.google.com/calendar/feeds/nobody@gmail.com/private/composite", $newOriginalEvent->href);
        $this->assertEquals("abcdef123456789", $newOriginalEvent->id);

        /* try constructing using magic factory */
        $gdata = new \Zend\GData\GData();
        $newOriginalEvent2 = $gdata->newOriginalEvent();
        $newOriginalEvent2->transferFromXML($newOriginalEvent->saveXML());
        $this->assertEquals(1, count($newOriginalEvent2->extensionElements));
        $this->assertEquals("http://www.google.com/calendar/feeds/nobody@gmail.com/private/composite", $newOriginalEvent2->href);
        $this->assertEquals("abcdef123456789", $newOriginalEvent2->id);
    }
Beispiel #9
0
 public function testNormalCommentsShouldHaveNoExtensionElements()
 {
     $this->comments->rel = "http://schemas.google.com/g/2005#regular";
     $this->assertEquals("http://schemas.google.com/g/2005#regular", $this->comments->rel);
     $this->assertEquals(0, count($this->comments->extensionElements));
     $newComments = new Extension\Comments();
     $newComments->transferFromXML($this->comments->saveXML());
     $this->assertEquals(0, count($newComments->extensionElements));
     $newComments->extensionElements = array(new \Zend\GData\App\Extension\Element('foo', 'atom', null, 'bar'));
     $this->assertEquals(1, count($newComments->extensionElements));
     $this->assertEquals("http://schemas.google.com/g/2005#regular", $newComments->rel);
     /* try constructing using magic factory */
     $gdata = new \Zend\GData\GData();
     $newComments2 = $gdata->newComments();
     $newComments2->transferFromXML($newComments->saveXML());
     $this->assertEquals(1, count($newComments2->extensionElements));
     $this->assertEquals("http://schemas.google.com/g/2005#regular", $newComments2->rel);
 }
 public function testNormalTransparencyShouldHaveNoExtensionElements()
 {
     $this->transparency->value = "http://schemas.google.com/g/2005#event.opaque";
     $this->assertEquals("http://schemas.google.com/g/2005#event.opaque", $this->transparency->value);
     $this->assertEquals(0, count($this->transparency->extensionElements));
     $newTransparency = new Extension\Transparency();
     $newTransparency->transferFromXML($this->transparency->saveXML());
     $this->assertEquals(0, count($newTransparency->extensionElements));
     $newTransparency->extensionElements = array(new \Zend\GData\App\Extension\Element('foo', 'atom', null, 'bar'));
     $this->assertEquals(1, count($newTransparency->extensionElements));
     $this->assertEquals("http://schemas.google.com/g/2005#event.opaque", $newTransparency->value);
     /* try constructing using magic factory */
     $gdata = new \Zend\GData\GData();
     $newTransparency2 = $gdata->newTransparency();
     $newTransparency2->transferFromXML($newTransparency->saveXML());
     $this->assertEquals(1, count($newTransparency2->extensionElements));
     $this->assertEquals("http://schemas.google.com/g/2005#event.opaque", $newTransparency2->value);
 }
 public function testNormalOpenSearchStartIndexShouldHaveNoExtensionElements()
 {
     $this->openSearchStartIndex->text = "20";
     $this->assertEquals("20", $this->openSearchStartIndex->text);
     $this->assertEquals(0, count($this->openSearchStartIndex->extensionElements));
     $newOpenSearchStartIndex = new Extension\OpenSearchStartIndex();
     $newOpenSearchStartIndex->transferFromXML($this->openSearchStartIndex->saveXML());
     $this->assertEquals(0, count($newOpenSearchStartIndex->extensionElements));
     $newOpenSearchStartIndex->extensionElements = array(new \Zend\GData\App\Extension\Element('foo', 'atom', null, 'bar'));
     $this->assertEquals(1, count($newOpenSearchStartIndex->extensionElements));
     $this->assertEquals("20", $newOpenSearchStartIndex->text);
     /* try constructing using magic factory */
     $gdata = new \Zend\GData\GData();
     $newOpenSearchStartIndex2 = $gdata->newOpenSearchStartIndex();
     $newOpenSearchStartIndex2->transferFromXML($newOpenSearchStartIndex->saveXML());
     $this->assertEquals(1, count($newOpenSearchStartIndex2->extensionElements));
     $this->assertEquals("20", $newOpenSearchStartIndex2->text);
 }
 public function testNormalRecurrenceExceptionShouldHaveNoExtensionElements()
 {
     $this->recurrenceException->specialized = "false";
     $this->assertEquals("false", $this->recurrenceException->specialized);
     $this->assertEquals(0, count($this->recurrenceException->extensionElements));
     $newRecurrenceException = new Extension\RecurrenceException();
     $newRecurrenceException->transferFromXML($this->recurrenceException->saveXML());
     $this->assertEquals(0, count($newRecurrenceException->extensionElements));
     $newRecurrenceException->extensionElements = array(new \Zend\GData\App\Extension\Element('foo', 'atom', null, 'bar'));
     $this->assertEquals(1, count($newRecurrenceException->extensionElements));
     $this->assertEquals("false", $newRecurrenceException->specialized);
     /* try constructing using magic factory */
     $gdata = new \Zend\GData\GData();
     $newRecurrenceException2 = $gdata->newRecurrenceException();
     $newRecurrenceException2->transferFromXML($newRecurrenceException->saveXML());
     $this->assertEquals(1, count($newRecurrenceException2->extensionElements));
     $this->assertEquals("false", $newRecurrenceException2->specialized);
 }
Beispiel #13
0
 public function testNormalRecurrenceShouldHaveNoExtensionElements()
 {
     $this->recurrence->text = "Foo";
     $this->assertEquals("Foo", $this->recurrence->text);
     $this->assertEquals(0, count($this->recurrence->extensionElements));
     $newRecurrence = new Extension\Recurrence();
     $newRecurrence->transferFromXML($this->recurrence->saveXML());
     $this->assertEquals(0, count($newRecurrence->extensionElements));
     $newRecurrence->extensionElements = array(new \Zend\GData\App\Extension\Element('foo', 'atom', null, 'bar'));
     $this->assertEquals(1, count($newRecurrence->extensionElements));
     $this->assertEquals("Foo", $newRecurrence->text);
     /* try constructing using magic factory */
     $gdata = new \Zend\GData\GData();
     $newRecurrence2 = $gdata->newRecurrence();
     $newRecurrence2->transferFromXML($newRecurrence->saveXML());
     $this->assertEquals(1, count($newRecurrence2->extensionElements));
     $this->assertEquals("Foo", $newRecurrence2->text);
 }
Beispiel #14
0
 public function testNormalAttendeeStatusShouldHaveNoExtensionElements()
 {
     $this->attendeeStatus->value = "http://schemas.google.com/g/2005#event.accepted";
     $this->assertEquals("http://schemas.google.com/g/2005#event.accepted", $this->attendeeStatus->value);
     $this->assertEquals(0, count($this->attendeeStatus->extensionElements));
     $newAttendeeStatus = new Extension\AttendeeStatus();
     $newAttendeeStatus->transferFromXML($this->attendeeStatus->saveXML());
     $this->assertEquals(0, count($newAttendeeStatus->extensionElements));
     $newAttendeeStatus->extensionElements = array(new \Zend\GData\App\Extension\Element('foo', 'atom', null, 'bar'));
     $this->assertEquals(1, count($newAttendeeStatus->extensionElements));
     $this->assertEquals("http://schemas.google.com/g/2005#event.accepted", $newAttendeeStatus->value);
     /* try constructing using magic factory */
     $gdata = new \Zend\GData\GData();
     $newAttendeeStatus2 = $gdata->newAttendeeStatus();
     $newAttendeeStatus2->transferFromXML($newAttendeeStatus->saveXML());
     $this->assertEquals(1, count($newAttendeeStatus2->extensionElements));
     $this->assertEquals("http://schemas.google.com/g/2005#event.accepted", $newAttendeeStatus2->value);
 }