diff options
Diffstat (limited to 'test/HTMLParserTest.php')
-rw-r--r-- | test/HTMLParserTest.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/HTMLParserTest.php b/test/HTMLParserTest.php index 9d7586e..d3e785a 100644 --- a/test/HTMLParserTest.php +++ b/test/HTMLParserTest.php @@ -40,9 +40,13 @@ class HTMLParserTest extends \PHPUnit_Framework_TestCase $source = file_get_contents($path . DIRECTORY_SEPARATOR . $testPage . DIRECTORY_SEPARATOR . 'source.html'); $expectedHTML = file_get_contents($path . DIRECTORY_SEPARATOR . $testPage . DIRECTORY_SEPARATOR . 'expected.html'); $expectedMetadata = file_get_contents($path . DIRECTORY_SEPARATOR . $testPage . DIRECTORY_SEPARATOR . 'expected-metadata.json'); - $config = file_get_contents($path . DIRECTORY_SEPARATOR . $testPage . DIRECTORY_SEPARATOR . 'config.json'); - if ($config) { - $config = json_decode($config, true); + + $config = null; + if (file_exists($path . DIRECTORY_SEPARATOR . $testPage . DIRECTORY_SEPARATOR . 'config.json')) { + $config = file_get_contents($path . DIRECTORY_SEPARATOR . $testPage . DIRECTORY_SEPARATOR . 'config.json'); + if ($config) { + $config = json_decode($config, true); + } } $pages[$testPage] = [$source, $expectedHTML, $expectedMetadata, $config]; |