diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/php/header/index.php | 4 | ||||
-rw-r--r-- | test/test_php_application.py | 40 |
2 files changed, 44 insertions, 0 deletions
diff --git a/test/php/header/index.php b/test/php/header/index.php new file mode 100644 index 00000000..1aa5ca04 --- /dev/null +++ b/test/php/header/index.php @@ -0,0 +1,4 @@ +<?php +header($_SERVER['HTTP_X_HEADER']); +header('Content-Length: 0'); +?> diff --git a/test/test_php_application.py b/test/test_php_application.py index 8032e96e..bf0d3bd1 100644 --- a/test/test_php_application.py +++ b/test/test_php_application.py @@ -102,6 +102,46 @@ class TestPHPApplication(TestApplicationPHP): self.assertEqual(resp['status'], 200, 'status') self.assertNotEqual(resp['body'], '', 'body not empty') + def test_php_application_header_status(self): + self.load('header') + + self.assertEqual( + self.get( + headers={ + 'Host': 'localhost', + 'Connection': 'close', + 'X-Header': 'HTTP/1.1 404 Not Found', + } + )['status'], + 404, + 'status', + ) + + self.assertEqual( + self.get( + headers={ + 'Host': 'localhost', + 'Connection': 'close', + 'X-Header': 'http/1.1 404 Not Found', + } + )['status'], + 404, + 'status case insensitive', + ) + + self.assertEqual( + self.get( + headers={ + 'Host': 'localhost', + 'Connection': 'close', + 'X-Header': 'HTTP/ 404 Not Found', + } + )['status'], + 404, + 'status version empty', + ) + + def test_php_application_404(self): self.load('404') |