Skip to content

Commit

Permalink
Add two tests for inexistant config files
Browse files Browse the repository at this point in the history
  • Loading branch information
jvoisin committed Dec 31, 2020
1 parent 3934044 commit c3a35b4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/tests/php8/inexistent_conf_file.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
Test for unexistent configuration file, in php8
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID < 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/config/unexistent_configuration_file.ini
--FILE--
<?php ?>
--EXPECTF--
Fatal error: [snuffleupagus][0.0.0.0][config][log] Could not open configuration file %a/config/unexistent_configuration_file.ini : No such file or directory in Unknown on line 0

Fatal error: [snuffleupagus][0.0.0.0][config][log] Invalid configuration file in Unknown on line 0
Could not startup.
14 changes: 14 additions & 0 deletions src/tests/php8/inexistent_conf_file_list.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--TEST--
Non-existent configuration file in a list in php8
--SKIPIF--
<?php if (!extension_loaded("snuffleupagus")) print "skip"; ?>
<?php if (PHP_VERSION_ID < 80000) print "skip"; ?>
--INI--
sp.configuration_file={PWD}/../../../config/default.rules,{PWD}/non_existent_configuration_file
--FILE--
<?php ?>
--EXPECTF--
Fatal error: [snuffleupagus][0.0.0.0][config][log] Could not open configuration file %a/non_existent_configuration_file : No such file or directory in Unknown on line 0

Fatal error: [snuffleupagus][0.0.0.0][config][log] Invalid configuration file in Unknown on line 0
Could not startup.

0 comments on commit c3a35b4

Please sign in to comment.