Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Test for double charset conversion fix
  • Loading branch information
blaaat committed Mar 23, 2018
commit 4046e83fdae8109770598fc332b081c1dfba55d4
8 changes: 8 additions & 0 deletions tests/DomTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ public function testIncorrectContentType()
$this->assertEquals($a->text, 'click here');
}

public function testCharsetConvertInAttribute()
{
$dom = new Dom;
$dom->loadFromFile(__DIR__ . '/files/ISO-8859-7.html', ['preserveLineBreaks' => true]);
$a = $dom->find('a', 0);
$this->assertEquals('/testη', $a->href);
}

public function testLoadSelfclosingAttr()
{
$dom = new Dom;
Expand Down
8 changes: 8 additions & 0 deletions tests/files/ISO-8859-7.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-7">
</head>
<body>
<a href="/test�">EE�<span>XX</span></a>
</body>
</html>