Example #1
0
 /**
  * @testdox asDOM() returns the template as a DOMDocument
  */
 public function testAsDOM()
 {
     $xml = '<div>foo</div>';
     $template = new Template($xml);
     $this->assertInstanceOf('DOMDocument', $template->asDOM());
     $this->assertContains($xml, $template->asDOM()->saveXML());
 }
 /**
  * @testdox saveChanges() updates the document's original template
  */
 public function testSaveChanges()
 {
     $template = new Template('<hr/>');
     $dom = $template->asDOM();
     $dom->documentElement->firstChild->setAttribute('id', 'x');
     $dom->saveChanges();
     $this->assertEquals('<hr id="x"/>', $template);
 }