Skip to content

Commit fd864dd

Browse files
committed
Added some arabic content with some HTML around it in tests.
1 parent e060b02 commit fd864dd

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

tests/htmldocTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ class = \'test\'
6666
//-->
6767
</script>',
6868
'<p data-attr="attribute"data-another="too close">No space between attributes</p>' => '<p data-attr="attribute" data-another="too close">No space between attributes</p>',
69-
'<p class="test""><span class="something">Extra Quote</span></p>' => '<p class="test"><span class="something">Extra Quote</span></p>'
69+
'<p class="test""><span class="something">Extra Quote</span></p>' => '<p class="test"><span class="something">Extra Quote</span></p>',
70+
'<a href="الشركاء/شركاء-الصناعة/">هنا</a>' => '<a href="الشركاء/شركاء-الصناعة/">هنا</a>'
7071
);
7172
$doc = new htmldoc();
7273
foreach ($tests AS $input => $output) {

tests/minifyHtmldocTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,4 +336,17 @@ public function testCanMinifyCssAndJs() {
336336
$doc->minify();
337337
$this->assertEquals($output, $doc->html(), 'Can load minified CSS and Javascript from cache');
338338
}
339+
340+
public function testCanMinifyDifficultHtml() {
341+
$tests = [
342+
'<a href="الشركاء/شركاء-الصناعة/">هنا</a>' => '<a href=الشركاء/شركاء-الصناعة/>هنا</a>'
343+
];
344+
$doc = new htmldoc();
345+
foreach ($tests AS $input => $output) {
346+
if ($doc->load($input, \mb_internal_encoding())) {
347+
$doc->minify();
348+
$this->assertEquals($output, $doc->html());
349+
}
350+
}
351+
}
339352
}

0 commit comments

Comments
 (0)