summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndres Rey <[email protected]>2018-03-18 19:38:53 +0000
committerAndres Rey <[email protected]>2018-03-18 19:38:53 +0000
commit4eed776f901446ba8edb54ff9babda2cd52706d4 (patch)
tree2e478742a45a5e028d27913ad971fc799798daae /test
parent1093b0a804ba48c146367b0bec45e33eb9b77116 (diff)
Use new configuration array on main test cases
Diffstat (limited to 'test')
-rw-r--r--test/ReadabilityTest.php17
1 files changed, 4 insertions, 13 deletions
diff --git a/test/ReadabilityTest.php b/test/ReadabilityTest.php
index 0e67d53..ec9a546 100644
--- a/test/ReadabilityTest.php
+++ b/test/ReadabilityTest.php
@@ -13,7 +13,7 @@ class ReadabilityTest extends \PHPUnit_Framework_TestCase
*/
public function testReadabilityParsesHTML($html, $expectedResult, $expectedMetadata, $config, $expectedImages)
{
- $options = ['originalURL' => 'http://fakehost/test/test.html',
+ $options = ['OriginalURL' => 'http://fakehost/test/test.html',
'FixRelativeURLs' => true,
'SubstituteEntities' => true,
'ArticleByLine' => true
@@ -27,12 +27,7 @@ class ReadabilityTest extends \PHPUnit_Framework_TestCase
$options = array_merge($config, $options);
}
- $configuration = new Configuration();
-
- foreach ($options as $key => $value) {
- $name = 'set' . $key;
- $configuration->$name($value);
- }
+ $configuration = new Configuration($options);
$readability = new Readability($configuration);
$readability->parse($html);
@@ -50,7 +45,7 @@ class ReadabilityTest extends \PHPUnit_Framework_TestCase
*/
public function testHTMLParserParsesImages($html, $expectedResult, $expectedMetadata, $config, $expectedImages)
{
- $options = ['originalURL' => 'http://fakehost/test/test.html',
+ $options = ['OriginalURL' => 'http://fakehost/test/test.html',
'fixRelativeURLs' => true,
'substituteEntities' => true,
];
@@ -58,12 +53,8 @@ class ReadabilityTest extends \PHPUnit_Framework_TestCase
if ($config) {
$options = array_merge($options, $config);
}
- $configuration = new Configuration();
- foreach ($options as $key => $value) {
- $name = 'set' . $key;
- $configuration->$name($value);
- }
+ $configuration = new Configuration($options);
$readability = new Readability($configuration);
$readability->parse($html);