public function Html5Test::testSave in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/masterminds/html5/test/HTML5/Html5Test.php \Masterminds\HTML5\Tests\Html5Test::testSave()
File
- vendor/
masterminds/ html5/ test/ HTML5/ Html5Test.php, line 122
Class
Namespace
Masterminds\HTML5\TestsCode
public function testSave() {
$dom = $this->html5
->load(__DIR__ . '/Html5Test.html');
$this
->assertInstanceOf('\\DOMDocument', $dom);
$this
->assertEmpty($this->html5
->getErrors());
// Test resource
$file = fopen('php://temp', 'w');
$this->html5
->save($dom, $file);
$content = stream_get_contents($file, -1, 0);
$this
->assertRegExp('|<p>This is a test.</p>|', $content);
// Test file
$tmpfname = tempnam(sys_get_temp_dir(), "html5-php");
$this->html5
->save($dom, $tmpfname);
$content = file_get_contents($tmpfname);
$this
->assertRegExp('|<p>This is a test.</p>|', $content);
unlink($tmpfname);
}