diff options
author | Pedro Amorim <[email protected]> | 2017-11-22 10:50:09 +0100 |
---|---|---|
committer | Pedro Amorim <[email protected]> | 2017-11-23 10:55:52 +0100 |
commit | e33dd203ca16c1827e6e2b25b7961dcbd77f3cb2 (patch) | |
tree | 961416d8724f260d557441a29b62d8ae7b649008 /test/HTMLParserTest.php | |
parent | 99db71502dd7221bd251785dba68a8fe93fdcb39 (diff) |
Add test testHTMLParserParsesImages()
Diffstat (limited to 'test/HTMLParserTest.php')
-rw-r--r-- | test/HTMLParserTest.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/HTMLParserTest.php b/test/HTMLParserTest.php index 96c07df..2aafa65 100644 --- a/test/HTMLParserTest.php +++ b/test/HTMLParserTest.php @@ -24,6 +24,24 @@ class HTMLParserTest extends \PHPUnit_Framework_TestCase $result = $readability->parse($html); $this->assertEquals($expectedResult, $result['html']); + } + + /** + * @dataProvider getSamplePages + */ + public function testHTMLParserParsesImages($html, $expectedResult, $expectedMetadata, $config, $expectedImages) + { + $options = ['originalURL' => 'http://fakehost/test/test.html', + 'fixRelativeURLs' => true, + 'substituteEntities' => true, + ]; + + if ($config) { + $options = array_merge($options, $config); + } + + $readability = new HTMLParser($options); + $result = $readability->parse($html); $this->assertEquals($expectedImages, json_encode($result['images'])); } |