Skip to content

Commit ec1b371

Browse files
authored
Merge pull request #12 from Paneon/develop
Make tests UTF-8 compatible
2 parents c828215 + 94491e3 commit ec1b371

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

tests/AbstractTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected function assertEqualHtml($expected, $actual)
3737
protected function createDocumentWithHtml(string $html): DOMDocument
3838
{
3939
$vueDocument = new DOMDocument('1.0', 'utf-8');
40-
@$vueDocument->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
40+
@$vueDocument->loadHTML('<?xml encoding="utf-8" ?>'.$html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
4141

4242
return $vueDocument;
4343
}

tests/CompilerTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,16 @@ public function setBannerAddsMultipleCommentsToTheTopOfTheTwigFile()
5151
$this->assertEqualHtml($expected, $actual);
5252

5353
}
54+
55+
/** @test */
56+
public function canHandleUTF8()
57+
{
58+
$html = '<template><div>Äöü: 10,00€</div></template>';
59+
$expected = '<div>Äöü: 10,00€</div>';
60+
61+
$compiler = $this->createCompiler($html);
62+
$actual = $compiler->convert();
63+
64+
$this->assertEqualHtml($expected, $actual);
65+
}
5466
}

0 commit comments

Comments
 (0)