mirror of
https://github.com/j0k3r/php-readability.git
synced 2026-09-27 06:26:17 +00:00
Avoid childnode becoming null to generate a warning
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user