Tests: PHP test with getting variable before the script is loaded.
This commit is contained in:
@@ -8,4 +8,6 @@ if (!fastcgi_finish_request()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo "4567";
|
echo "4567";
|
||||||
|
|
||||||
|
include 'server.php';
|
||||||
?>
|
?>
|
||||||
|
|||||||
4
test/php/fastcgi_finish_request/server.php
Normal file
4
test/php/fastcgi_finish_request/server.php
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?php
|
||||||
|
echo $_SERVER['REQUEST_METHOD'];
|
||||||
|
echo $_SERVER['HTTP_HOST'];
|
||||||
|
?>
|
||||||
@@ -98,9 +98,14 @@ class TestPHPApplication(TestApplicationPHP):
|
|||||||
def test_php_application_fastcgi_finish_request(self, unit_pid):
|
def test_php_application_fastcgi_finish_request(self, unit_pid):
|
||||||
self.load('fastcgi_finish_request')
|
self.load('fastcgi_finish_request')
|
||||||
|
|
||||||
|
assert 'success' in self.conf(
|
||||||
|
{"admin": {"auto_globals_jit": "1"}},
|
||||||
|
'applications/fastcgi_finish_request/options',
|
||||||
|
)
|
||||||
|
|
||||||
assert self.get()['body'] == '0123'
|
assert self.get()['body'] == '0123'
|
||||||
|
|
||||||
os.kill(unit_pid, signal.SIGUSR1);
|
os.kill(unit_pid, signal.SIGUSR1)
|
||||||
|
|
||||||
errs = self.findall(r'Error in fastcgi_finish_request')
|
errs = self.findall(r'Error in fastcgi_finish_request')
|
||||||
|
|
||||||
@@ -109,11 +114,16 @@ class TestPHPApplication(TestApplicationPHP):
|
|||||||
def test_php_application_fastcgi_finish_request_2(self, unit_pid):
|
def test_php_application_fastcgi_finish_request_2(self, unit_pid):
|
||||||
self.load('fastcgi_finish_request')
|
self.load('fastcgi_finish_request')
|
||||||
|
|
||||||
|
assert 'success' in self.conf(
|
||||||
|
{"admin": {"auto_globals_jit": "1"}},
|
||||||
|
'applications/fastcgi_finish_request/options',
|
||||||
|
)
|
||||||
|
|
||||||
resp = self.get(url='/?skip')
|
resp = self.get(url='/?skip')
|
||||||
assert resp['status'] == 200
|
assert resp['status'] == 200
|
||||||
assert resp['body'] == ''
|
assert resp['body'] == ''
|
||||||
|
|
||||||
os.kill(unit_pid, signal.SIGUSR1);
|
os.kill(unit_pid, signal.SIGUSR1)
|
||||||
|
|
||||||
errs = self.findall(r'Error in fastcgi_finish_request')
|
errs = self.findall(r'Error in fastcgi_finish_request')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user