diff options
Diffstat (limited to '')
-rw-r--r-- | test/php/ini_precision/index.php | 4 | ||||
-rw-r--r-- | test/php/ini_precision/php.ini | 1 | ||||
-rw-r--r-- | test/test_php_application.py | 12 | ||||
-rw-r--r-- | test/unit.py | 1 |
4 files changed, 18 insertions, 0 deletions
diff --git a/test/php/ini_precision/index.php b/test/php/ini_precision/index.php new file mode 100644 index 00000000..3b733e5c --- /dev/null +++ b/test/php/ini_precision/index.php @@ -0,0 +1,4 @@ +<?php +header('X-File: ' . php_ini_loaded_file()); +header('X-Precision: ' . ini_get('precision')); +?> diff --git a/test/php/ini_precision/php.ini b/test/php/ini_precision/php.ini new file mode 100644 index 00000000..51dbdede --- /dev/null +++ b/test/php/ini_precision/php.ini @@ -0,0 +1 @@ +precision = 4 diff --git a/test/test_php_application.py b/test/test_php_application.py index 9ac063c7..37467019 100644 --- a/test/test_php_application.py +++ b/test/test_php_application.py @@ -118,5 +118,17 @@ class TestUnitPHPApplication(unit.TestUnitApplicationPHP): self.assertEqual(resp['headers']['X-Cookie-1'], 'val', 'cookie') self.assertEqual(resp['headers']['X-Cookie-2'], 'val2', 'cookie') + def test_php_application_ini_precision(self): + self.load('ini_precision') + + self.assertNotEqual(self.get()['headers']['X-Precision'], '4', + 'ini value default') + + self.conf({"file": "php.ini"}, '/applications/ini_precision/options') + + self.assertEqual(self.get()['headers']['X-File'], + self.current_dir + '/php/ini_precision/php.ini', 'ini file') + self.assertEqual(self.get()['headers']['X-Precision'], '4', 'ini value') + if __name__ == '__main__': unittest.main() diff --git a/test/unit.py b/test/unit.py index 2f187d91..06ee2d76 100644 --- a/test/unit.py +++ b/test/unit.py @@ -395,6 +395,7 @@ class TestUnitApplicationPHP(TestUnitApplicationProto): "type": "php", "processes": { "spare": 0 }, "root": self.current_dir + '/php/' + script, + "working_directory": self.current_dir + '/php/' + script, "index": name } } |