assertEquals('foo', $notification->getId()); $this->assertEquals('"1"', $notification->getETag()); $writer = new Writer(); $writer->namespaceMap = [ 'http://calendarserver.org/ns/' => 'cs', ]; $writer->openMemory(); $writer->startDocument('1.0', 'UTF-8'); $writer->startElement('{http://calendarserver.org/ns/}root'); $writer->write($notification); $writer->endElement(); $this->assertXmlStringEqualsXmlString($expected1, $writer->outputMemory()); $writer = new Writer(); $writer->namespaceMap = [ 'http://calendarserver.org/ns/' => 'cs', 'DAV:' => 'd', ]; $writer->openMemory(); $writer->startDocument('1.0', 'UTF-8'); $writer->startElement('{http://calendarserver.org/ns/}root'); $notification->xmlSerializeFull($writer);; $writer->endElement(); $this->assertXmlStringEqualsXmlString($expected2, $writer->outputMemory()); } function dataProvider() { return [ [ new SystemStatus('foo', '"1"'), '' . "\n" . '' . "\n", '' . "\n" . '' . "\n", ], [ new SystemStatus('foo', '"1"', SystemStatus::TYPE_MEDIUM,'bar'), '' . "\n" . '' . "\n", '' . "\n" . 'bar' . "\n", ], [ new SystemStatus('foo', '"1"', SystemStatus::TYPE_LOW,null,'http://example.org/'), '' . "\n" . '' . "\n", '' . "\n" . 'http://example.org/' . "\n", ] ]; } }