Tests: added PHP test with invalid index extension only.
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
|
import os
|
||||||
import re
|
import re
|
||||||
|
import shutil
|
||||||
import unittest
|
import unittest
|
||||||
from unit.applications.lang.php import TestApplicationPHP
|
from unit.applications.lang.php import TestApplicationPHP
|
||||||
|
|
||||||
@@ -512,5 +514,33 @@ class TestPHPApplication(TestApplicationPHP):
|
|||||||
self.get(url='/index.wrong')['status'], 200, 'status'
|
self.get(url='/index.wrong')['status'], 200, 'status'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
new_root = self.testdir + "/php"
|
||||||
|
os.mkdir(new_root)
|
||||||
|
shutil.copy(self.current_dir + '/php/phpinfo/index.wrong', new_root)
|
||||||
|
|
||||||
|
self.assertIn(
|
||||||
|
'success',
|
||||||
|
self.conf(
|
||||||
|
{
|
||||||
|
"listeners": {"*:7080": {"pass": "applications/phpinfo"}},
|
||||||
|
"applications": {
|
||||||
|
"phpinfo": {
|
||||||
|
"type": "php",
|
||||||
|
"processes": {"spare": 0},
|
||||||
|
"root": new_root,
|
||||||
|
"working_directory": new_root,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
),
|
||||||
|
'configure new root',
|
||||||
|
)
|
||||||
|
|
||||||
|
resp = self.get()
|
||||||
|
self.assertNotEqual(
|
||||||
|
str(resp['status']) + resp['body'], '200', 'status new root'
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
TestPHPApplication.main()
|
TestPHPApplication.main()
|
||||||
|
|||||||
Reference in New Issue
Block a user