public function testMarshallQandA() { $q = new Q('albert-einstein'); $a = new A('http://en.wikipedia.org/wiki/Physicist'); $a->setType('text/html'); $a->setContent(new InlineCollection(array(new TextRun('physicist')))); $q->setContent(new InlineCollection(array(new TextRun('Albert Einstein is a '), $a, new TextRun('.')))); $marshaller = $this->getMarshallerFactory()->createMarshaller($q); $element = $marshaller->marshall($q); $dom = new DOMDocument('1.0', 'UTF-8'); $element = $dom->importNode($element, true); $this->assertEquals('<q id="albert-einstein">Albert Einstein is a <a href="http://en.wikipedia.org/wiki/Physicist" type="text/html">physicist</a>.</q>', $dom->saveXML($element)); }
public function testMarshall22DirAuto() { $q = new Q('albert'); $q->setDir(Direction::AUTO); $marshaller = $this->getMarshallerFactory('2.2.0')->createMarshaller($q); $element = $marshaller->marshall($q); $dom = new DOMDocument('1.0', 'UTF-8'); $element = $dom->importNode($element, true); $this->assertEquals('<q id="albert"/>', $dom->saveXML($element)); }