assertEquals('foo', $notification->getId()); $dom = new DOMDocument('1.0','UTF-8'); $elem = $dom->createElement('cs:root'); $elem->setAttribute('xmlns:cs',Sabre_CalDAV_Plugin::NS_CALENDARSERVER); $dom->appendChild($elem); $notification->serialize(new Sabre_DAV_Server(), $elem); $this->assertEquals($expected1, $dom->saveXML()); $dom = new DOMDocument('1.0','UTF-8'); $elem = $dom->createElement('cs:root'); $elem->setAttribute('xmlns:cs',Sabre_CalDAV_Plugin::NS_CALENDARSERVER); $dom->appendChild($elem); $notification->serializeBody(new Sabre_DAV_Server(), $elem); $this->assertEquals($expected2, $dom->saveXML()); } function dataProvider() { return array( array( new Sabre_CalDAV_Notifications_Notification_SystemStatus('foo'), '' . "\n" . '' . "\n", '' . "\n" . '' . "\n", ), array( new Sabre_CalDAV_Notifications_Notification_SystemStatus('foo',Sabre_CalDAV_Notifications_Notification_SystemStatus::TYPE_MEDIUM,'bar'), '' . "\n" . '' . "\n", '' . "\n" . 'bar' . "\n", ), array( new Sabre_CalDAV_Notifications_Notification_SystemStatus('foo',Sabre_CalDAV_Notifications_Notification_SystemStatus::TYPE_LOW,null,'http://example.org/'), '' . "\n" . '' . "\n", '' . "\n" . 'http://example.org/' . "\n", ) ); } }