/** * @covers ByJG\Util\XmlUtil::addTextNode */ public function testAddTextNode() { $dom = XmlUtil::createXmlDocumentFromStr('<root><subject></subject></root>'); $node = XmlUtil::selectSingleNode($dom->documentElement, 'subject'); XmlUtil::addTextNode($node, 'Text'); $this->assertEquals(self::XMLHEADER . "\n" . '<root>' . '<subject>' . 'Text' . '</subject>' . '</root>' . "\n", $dom->saveXML()); }