Skip to content

Commit acda009

Browse files
committed
Added test for HTML fragment language testing (#121)
1 parent 23aabcb commit acda009

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/Mf2/ParseLanguageTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ public function testHtmlAndHEntryLang()
5252
$this->assertEquals('es', $result['items'][0]['properties']['html-lang']);
5353
} # end method testHtmlAndHEntryLang()
5454

55+
/**
56+
* Test HTML fragment with only h-entry lang
57+
*/
58+
public function testFragmentHEntryLangOnly()
59+
{
60+
$input = '<div class="h-entry" lang="en">This test is in English.</div>';
61+
$parser = new Parser($input);
62+
$result = $parser->parse();
63+
64+
$this->assertEquals('en', $result['items'][0]['properties']['html-lang']);
65+
} # end method testFragmentHEntryLangOnly()
66+
5567
/**
5668
* Test with different <html lang>, h-entry lang, and h-entry without lang,
5769
* which should inherit from the <html lang>

0 commit comments

Comments
 (0)