Deleted Added
1import os
2import re
3import shutil
4import unittest
5from unit.applications.lang.php import TestApplicationPHP
6
7class TestPHPApplication(TestApplicationPHP):
8 prerequisites = {'modules': ['php']}

--- 169 unchanged lines hidden (view full) ---

178 resp['body'], r'<title>404 Not Found</title>', '404 body'
179 )
180
181 def test_php_application_keepalive_body(self):
182 self.load('mirror')
183
184 self.assertEqual(self.get()['status'], 200, 'init')
185
186 body = '0123456789' * 500
187 (resp, sock) = self.post(
188 headers={
189 'Host': 'localhost',
190 'Connection': 'keep-alive',
191 'Content-Type': 'text/html',
192 },
193 start=True,
194 body=body,
195 read_timeout=1,
196 )
197
198 self.assertEqual(resp['body'], body, 'keep-alive 1')
199
200 body = '0123456789'
201 resp = self.post(
202 headers={
203 'Host': 'localhost',
204 'Connection': 'close',
205 'Content-Type': 'text/html',
206 },
207 sock=sock,
208 body=body,
209 )
210
211 self.assertEqual(resp['body'], body, 'keep-alive 2')
212
213 def test_php_application_conditional(self):
214 self.load('conditional')
215
216 self.assertRegex(self.get()['body'], r'True', 'conditional true')
217 self.assertRegex(self.post()['body'], r'False', 'conditional false')
218
219 def test_php_application_get_variables(self):

--- 456 unchanged lines hidden ---