Skip to content

Commit

Permalink
Merge pull request #12 from Paneon/develop
Browse files Browse the repository at this point in the history
Make tests UTF-8 compatible
  • Loading branch information
Macavity authored Jan 30, 2019
2 parents c828215 + 94491e3 commit ec1b371
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/AbstractTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected function assertEqualHtml($expected, $actual)
protected function createDocumentWithHtml(string $html): DOMDocument
{
$vueDocument = new DOMDocument('1.0', 'utf-8');
@$vueDocument->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
@$vueDocument->loadHTML('<?xml encoding="utf-8" ?>'.$html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);

return $vueDocument;
}
Expand Down
12 changes: 12 additions & 0 deletions tests/CompilerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,16 @@ public function setBannerAddsMultipleCommentsToTheTopOfTheTwigFile()
$this->assertEqualHtml($expected, $actual);

}

/** @test */
public function canHandleUTF8()
{
$html = '<template><div>Äöü: 10,00€</div></template>';
$expected = '<div>Äöü: 10,00€</div>';

$compiler = $this->createCompiler($html);
$actual = $compiler->convert();

$this->assertEqualHtml($expected, $actual);
}
}

0 comments on commit ec1b371

Please sign in to comment.