summaryrefslogtreecommitdiffhomepage
path: root/test/test_php_application.py
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2021-11-09 15:48:44 +0300
committerMax Romanov <max.romanov@nginx.com>2021-11-09 15:48:44 +0300
commitb424a00ec5746884f8ebb1d75b3f0fec0b3a05ff (patch)
tree77c7ca06d1298d97c9818eb9f875e9dc41508f44 /test/test_php_application.py
parent506ec2b8258cfe03d0d7e3b19eb79d1075a6174c (diff)
downloadunit-b424a00ec5746884f8ebb1d75b3f0fec0b3a05ff.tar.gz
unit-b424a00ec5746884f8ebb1d75b3f0fec0b3a05ff.tar.bz2
Tests: PHP shared opcache test added.
Diffstat (limited to '')
-rw-r--r--test/test_php_application.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test_php_application.py b/test/test_php_application.py
index bb7d978c..d9c16a6d 100644
--- a/test/test_php_application.py
+++ b/test/test_php_application.py
@@ -713,3 +713,20 @@ class TestPHPApplication(TestApplicationPHP):
), 'relative path w/ chdir'
assert self.get()['body'] == 'test', 'relative path 2'
+
+ def test_php_application_shared_opcache(self):
+ self.load('opcache', limits={'requests': 1})
+
+ r = self.get()
+ cached = r['headers']['X-Cached']
+ if cached == '-1':
+ pytest.skip('opcache is not supported')
+
+ pid = r['headers']['X-Pid']
+
+ assert cached == '0', 'not cached'
+
+ r = self.get()
+
+ assert r['headers']['X-Pid'] != pid, 'new instance'
+ assert r['headers']['X-Cached'] == '1', 'cached'