Commit f101447a authored by Joschi Kuphal's avatar Joschi Kuphal

Added XML loading test for HTML fragment language testing (#121)

parent acda009e
......@@ -64,6 +64,31 @@ class ParseLanguageTest extends PHPUnit_Framework_TestCase {
$this->assertEquals('en', $result['items'][0]['properties']['html-lang']);
} # end method testFragmentHEntryLangOnly()
/**
* Test HTML fragment with no lang
*/
public function testFragmentHEntryNoLang()
{
$input = '<div class="h-entry">This test is in English.</div>';
$parser = new Parser($input);
$result = $parser->parse();
$this->assertFalse(isset($result['items'][0]['properties']['html-lang']));
} # end method testFragmentHEntryNoLang()
/**
* Test HTML fragment with no lang, loaded with loadXML()
*/
public function testFragmentHEntryNoLangXML()
{
$input = new \DOMDocument();
$input->loadXML('<div class="h-entry">This test is in English.</div>');
$parser = new Parser($input);
$result = $parser->parse();
$this->assertFalse(isset($result['items'][0]['properties']['html-lang']));
} # end method testFragmentHEntryNoLangXML()
/**
* Test with different <html lang>, h-entry lang, and h-entry without lang,
* which should inherit from the <html lang>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment