diff options
author | ArthurHoaro <arthur@hoa.ro> | 2017-03-12 16:09:34 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2017-03-12 16:09:34 +0100 |
commit | c6a4c2882d89c6bcceeeccd319549611a5d1801b (patch) | |
tree | d402f0c42c04a480b086d354951ad1f0c8732696 /tests/config/ConfigJsonTest.php | |
parent | 7fc5f07492b9bfe58cb33907ceb42e9bccd624ce (diff) | |
download | Shaarli-c6a4c2882d89c6bcceeeccd319549611a5d1801b.tar.gz Shaarli-c6a4c2882d89c6bcceeeccd319549611a5d1801b.tar.zst Shaarli-c6a4c2882d89c6bcceeeccd319549611a5d1801b.zip |
Proper error if the conf file is invalid instead of fatal error
Error:
An error occurred while parsing configuration JSON file (data/config.json.php): error code #4
➜ Syntax error
Please check your JSON syntax (without PHP comment tags) using a JSON lint tool such as jsonlint.com.
Diffstat (limited to 'tests/config/ConfigJsonTest.php')
-rw-r--r-- | tests/config/ConfigJsonTest.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/config/ConfigJsonTest.php b/tests/config/ConfigJsonTest.php index 3527f83d..d237bc80 100644 --- a/tests/config/ConfigJsonTest.php +++ b/tests/config/ConfigJsonTest.php | |||
@@ -40,7 +40,7 @@ class ConfigJsonTest extends \PHPUnit_Framework_TestCase | |||
40 | * Read a non existent config file -> empty array. | 40 | * Read a non existent config file -> empty array. |
41 | * | 41 | * |
42 | * @expectedException \Exception | 42 | * @expectedException \Exception |
43 | * @expectedExceptionMessage An error occurred while parsing JSON file: error code #4 | 43 | * @expectedExceptionMessageRegExp /An error occurred while parsing JSON configuration file \([\w\/\.]+\): error code #4/ |
44 | */ | 44 | */ |
45 | public function testReadInvalidJson() | 45 | public function testReadInvalidJson() |
46 | { | 46 | { |