Skip to content

Commit 44ff776

Browse files
committed
Fix test
1 parent ab776a0 commit 44ff776

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test/HTML5/Html5Test.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function testLoadOptions()
8585

8686
public function testEncodingUtf8()
8787
{
88-
$dom = $this->html5->load(__DIR__.'/Fixtures/encoding/utf-8.html');
88+
$dom = $this->html5->load(__DIR__ . '/Fixtures/encoding/utf-8.html');
8989
$this->assertInstanceOf('\DOMDocument', $dom);
9090
$this->assertEmpty($this->html5->getErrors());
9191
$this->assertFalse($this->html5->hasErrors());
@@ -95,15 +95,19 @@ public function testEncodingUtf8()
9595

9696
public function testEncodingWindows1252()
9797
{
98-
$dom = $this->html5->load(__DIR__.'/Fixtures/encoding/windows-1252.html', array(
98+
$dom = $this->html5->load(__DIR__ . '/Fixtures/encoding/windows-1252.html', array(
9999
'encoding' => 'Windows-1252',
100100
));
101101

102102
$this->assertInstanceOf('\DOMDocument', $dom);
103103
$this->assertEmpty($this->html5->getErrors());
104104
$this->assertFalse($this->html5->hasErrors());
105105

106-
$this->assertContains('Ž�èýù', mb_convert_encoding($dom->saveHTML(), 'UTF-8', 'Windows-1252'));
106+
$dumpedAsUtf8 = mb_convert_encoding($dom->saveHTML(), 'UTF-8', 'Windows-1252');
107+
$this->assertNotFalse(mb_strpos($dumpedAsUtf8, 'Ž'));
108+
$this->assertNotFalse(mb_strpos($dumpedAsUtf8, 'è'));
109+
$this->assertNotFalse(mb_strpos($dumpedAsUtf8, 'ý'));
110+
$this->assertNotFalse(mb_strpos($dumpedAsUtf8, 'ù'));
107111
}
108112

109113
public function testErrors()

0 commit comments

Comments
 (0)