diff options
author | Tiago Natel de Moura <t.nateldemoura@f5.com> | 2020-01-23 11:57:15 +0000 |
---|---|---|
committer | Tiago Natel de Moura <t.nateldemoura@f5.com> | 2020-01-23 11:57:15 +0000 |
commit | 117a4f11b9c0af40810e492841b181e418dad165 (patch) | |
tree | 670bb301fc71565f62ad7ac84d30c64a82c80e97 /test | |
parent | f860c20a96d9d844aad53f81dfcfc72f30ff977e (diff) | |
download | unit-117a4f11b9c0af40810e492841b181e418dad165.tar.gz unit-117a4f11b9c0af40810e492841b181e418dad165.tar.bz2 |
Tests: check for php extension.
Diffstat (limited to '')
-rw-r--r-- | test/php/phpinfo/index.wrong | 3 | ||||
-rw-r--r-- | test/test_php_application.py | 12 |
2 files changed, 14 insertions, 1 deletions
diff --git a/test/php/phpinfo/index.wrong b/test/php/phpinfo/index.wrong new file mode 100644 index 00000000..6c9e0678 --- /dev/null +++ b/test/php/phpinfo/index.wrong @@ -0,0 +1,3 @@ +<?php +header('Content-Length: 0'); +?> diff --git a/test/test_php_application.py b/test/test_php_application.py index d614885c..837181e6 100644 --- a/test/test_php_application.py +++ b/test/test_php_application.py @@ -500,7 +500,17 @@ class TestPHPApplication(TestApplicationPHP): ), 'configure index default' ) - self.assertEqual(self.get()['status'], 200, 'status') + resp = self.get() + + self.assertEqual(resp['status'], 200, 'status') + self.assertNotEqual(resp['body'], '', 'body not empty') + + def test_php_application_extension_check(self): + self.load('phpinfo') + + self.assertNotEqual( + self.get(url='/index.wrong')['status'], 200, 'status' + ) if __name__ == '__main__': TestPHPApplication.main() |