diff options
author | Andrei Zeliankou <zelenkov@nginx.com> | 2020-02-20 21:06:56 +0000 |
---|---|---|
committer | Andrei Zeliankou <zelenkov@nginx.com> | 2020-02-20 21:06:56 +0000 |
commit | 5406d1e320eca0a94eeffe2e57e2e2b4d989e0d1 (patch) | |
tree | 0a92fc889ed3a8c181b2b504881d0141b675a528 /test/test_php_application.py | |
parent | 1f2445b01b04bf47409fe9aace990c7054a638a6 (diff) | |
download | unit-5406d1e320eca0a94eeffe2e57e2e2b4d989e0d1.tar.gz unit-5406d1e320eca0a94eeffe2e57e2e2b4d989e0d1.tar.bz2 |
Tests: added PHP test with invalid index extension only.
Diffstat (limited to 'test/test_php_application.py')
-rw-r--r-- | test/test_php_application.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/test_php_application.py b/test/test_php_application.py index 837181e6..37606fa2 100644 --- a/test/test_php_application.py +++ b/test/test_php_application.py @@ -1,4 +1,6 @@ +import os import re +import shutil import unittest from unit.applications.lang.php import TestApplicationPHP @@ -512,5 +514,33 @@ class TestPHPApplication(TestApplicationPHP): self.get(url='/index.wrong')['status'], 200, 'status' ) + new_root = self.testdir + "/php" + os.mkdir(new_root) + shutil.copy(self.current_dir + '/php/phpinfo/index.wrong', new_root) + + self.assertIn( + 'success', + self.conf( + { + "listeners": {"*:7080": {"pass": "applications/phpinfo"}}, + "applications": { + "phpinfo": { + "type": "php", + "processes": {"spare": 0}, + "root": new_root, + "working_directory": new_root, + } + }, + } + ), + 'configure new root', + ) + + resp = self.get() + self.assertNotEqual( + str(resp['status']) + resp['body'], '200', 'status new root' + ) + + if __name__ == '__main__': TestPHPApplication.main() |