/** * @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); }
/** * @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); }