write([ '{' . self::NS_CALENDARSERVER . '}publish-url' => $publish, ]); $this->assertEquals('urltopublish', $publish->getValue()); $this->assertXmlStringEqualsXmlString( ' urltopublish ', $xml); } public function testSerializeNotPublished(): void { $publish = new Publisher('urltopublish', false); $xml = $this->write([ '{' . self::NS_CALENDARSERVER . '}pre-publish-url' => $publish, ]); $this->assertEquals('urltopublish', $publish->getValue()); $this->assertXmlStringEqualsXmlString( ' urltopublish', $xml); } protected $elementMap = []; protected $namespaceMap = ['DAV:' => 'd']; protected $contextUri = '/'; private function write($input) { $writer = new Writer(); $writer->contextUri = $this->contextUri; $writer->namespaceMap = $this->namespaceMap; $writer->openMemory(); $writer->setIndent(true); $writer->write($input); return $writer->outputMemory(); } }