From 7336a8080e8b1611795d8038e2b816340ce3e4e1 Mon Sep 17 00:00:00 2001 From: Stefan Esser Date: Sat, 15 Feb 2014 20:59:01 +0100 Subject: Some "incomplete" tests for suhosin.server.strip and suhosin.server.encode --- tests/filter/server_encode_off.phpt | 31 +++++++++++++++++++++++++++++++ tests/filter/server_encode_on.phpt | 30 ++++++++++++++++++++++++++++++ tests/filter/server_strip_off.phpt | 27 +++++++++++++++++++++++++++ tests/filter/server_strip_on.phpt | 27 +++++++++++++++++++++++++++ 4 files changed, 115 insertions(+) create mode 100644 tests/filter/server_encode_off.phpt create mode 100644 tests/filter/server_encode_on.phpt create mode 100644 tests/filter/server_strip_off.phpt create mode 100644 tests/filter/server_strip_on.phpt diff --git a/tests/filter/server_encode_off.phpt b/tests/filter/server_encode_off.phpt new file mode 100644 index 0000000..8daccea --- /dev/null +++ b/tests/filter/server_encode_off.phpt @@ -0,0 +1,31 @@ +--TEST-- +Testing: suhosin.server.encode=Off +--DESCRIPTION-- +This test is incomplete but at the moment we cannot do better with the standard test framework. +--INI-- +suhosin.log.syslog=0 +suhosin.log.sapi=0 +suhosin.log.stdout=255 +suhosin.log.script=0 +suhosin.server.encode=Off +--SKIPIF-- + +--ENV-- +return <<"'`!AAA +END; +--COOKIE-- +--GET-- +BBB<>"'`!BBB +--POST-- +--FILE-- + +--EXPECTF-- +string(12) "AAA<>"'`!AAA" +string(12) "BBB<>"'`!BBB" + + diff --git a/tests/filter/server_encode_on.phpt b/tests/filter/server_encode_on.phpt new file mode 100644 index 0000000..4cd7a66 --- /dev/null +++ b/tests/filter/server_encode_on.phpt @@ -0,0 +1,30 @@ +--TEST-- +Testing: suhosin.server.encode=On +--DESCRIPTION-- +This test is incomplete but at the moment we cannot do better with the standard test framework. +--INI-- +suhosin.log.syslog=0 +suhosin.log.sapi=0 +suhosin.log.stdout=255 +suhosin.log.script=0 +suhosin.server.encode=On +--SKIPIF-- + +--ENV-- +return <<"'`!AAA +END; +--COOKIE-- +--GET-- +BBB<>"'`!BBB +--POST-- +--FILE-- + +--EXPECTF-- +string(22) "AAA%3C%3E%22%27%60!AAA" +string(22) "BBB%3C%3E%22%27%60!BBB" + diff --git a/tests/filter/server_strip_off.phpt b/tests/filter/server_strip_off.phpt new file mode 100644 index 0000000..75c326e --- /dev/null +++ b/tests/filter/server_strip_off.phpt @@ -0,0 +1,27 @@ +--TEST-- +Testing: suhosin.server.strip=Off +--DESCRIPTION-- +This test is incomplete but at the moment we cannot do better with the standard test framework. +--INI-- +suhosin.log.syslog=0 +suhosin.log.sapi=0 +suhosin.log.stdout=255 +suhosin.log.script=0 +suhosin.server.strip=Off +--SKIPIF-- + +--ENV-- +return <<"'`!AAA +END; +--COOKIE-- +--GET-- +A=B +--POST-- +--FILE-- + +--EXPECTF-- +string(40) "X/index.php/THIS_IS_A_FAKE_NAME<>"'`!AAA" diff --git a/tests/filter/server_strip_on.phpt b/tests/filter/server_strip_on.phpt new file mode 100644 index 0000000..c595e95 --- /dev/null +++ b/tests/filter/server_strip_on.phpt @@ -0,0 +1,27 @@ +--TEST-- +Testing: suhosin.server.strip=On +--DESCRIPTION-- +This test is incomplete but at the moment we cannot do better with the standard test framework. +--INI-- +suhosin.log.syslog=0 +suhosin.log.sapi=0 +suhosin.log.stdout=255 +suhosin.log.script=0 +suhosin.server.strip=On +--SKIPIF-- + +--ENV-- +return <<"'`!AAA +END; +--COOKIE-- +--GET-- +A=B +--POST-- +--FILE-- + +--EXPECTF-- +string(40) "X/index.php/THIS_IS_A_FAKE_NAME?????!AAA" -- cgit v1.3