Avoid childnode becoming null to generate a warning

This commit is contained in:
Jeremy Benoist
2017-01-10 10:58:12 +01:00
parent ade850534c
commit ff754b80bd
3 changed files with 155 additions and 0 deletions
+13
View File
@@ -464,4 +464,17 @@ class ReadabilityTest extends \PHPUnit_Framework_TestCase
$this->assertTrue($res);
$this->assertContains('This the awesome and WONDERFUL content :)', $readability->getContent()->innerHTML);
}
public function testChildNodeGoneNull()
{
// from http://www.ayyaantuu.net/ethiopia-targets-opposition-lawmakers/
$html = file_get_contents('tests/fixtures/childNodeGoesNull.html');
$readability = $this->getReadability($html, 'http://0.0.0.0');
$readability->debug = true;
$readability->convertLinksToFootnotes = true;
$res = $readability->init();
$this->assertTrue($res);
}
}