Esempio n. 1
0
 /**
  * @group CoreFunctions
  * @covers FluentDOMCore::spawn
  */
 public function testSpawnWithElements()
 {
     $dom = new DOMDocument();
     $node = $dom->createElement('test');
     $dom->appendChild($node);
     $fdParent = new FluentDOMCore();
     $fdParent->load($dom);
     $fdChild = $fdParent->spawn($node);
     $this->assertAttributeSame(array($node), '_array', $fdChild);
 }
Esempio n. 2
0
 /**
  * @group CoreFunctions
  * @covers FluentDOMCore::formatOutput
  */
 public function testFormatOutputWithContentTypeHtml()
 {
     $fd = new FluentDOMCore();
     $fd->load('<html><body><br/></body></html>');
     $fd->formatOutput('text/html');
     $expected = "<html><body><br></body></html>\n";
     $this->assertSame('text/html', $this->readAttribute($fd, '_contentType'));
     $this->assertSame($expected, (string) $fd);
 }