diff options
Diffstat (limited to 'src/tests/cookies_encryption_warning')
8 files changed, 92 insertions, 0 deletions
diff --git a/src/tests/cookies_encryption_warning/config/encrypt_cookies_no_env.ini b/src/tests/cookies_encryption_warning/config/encrypt_cookies_no_env.ini new file mode 100644 index 0000000..845bd02 --- /dev/null +++ b/src/tests/cookies_encryption_warning/config/encrypt_cookies_no_env.ini | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | sp.global.secret_key("abcdef"); | ||
| 2 | sp.cookie.name("super_cookie").encrypt(); | ||
diff --git a/src/tests/cookies_encryption_warning/config/encrypt_cookies_no_key.ini b/src/tests/cookies_encryption_warning/config/encrypt_cookies_no_key.ini new file mode 100644 index 0000000..a585e12 --- /dev/null +++ b/src/tests/cookies_encryption_warning/config/encrypt_cookies_no_key.ini | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | sp.global.cookie_env_var("TEST"); | ||
| 2 | sp.cookie.name("super_cookie").encrypt(); | ||
diff --git a/src/tests/cookies_encryption_warning/config/encrypt_regexp_cookies_no_env.ini b/src/tests/cookies_encryption_warning/config/encrypt_regexp_cookies_no_env.ini new file mode 100644 index 0000000..0e1fa30 --- /dev/null +++ b/src/tests/cookies_encryption_warning/config/encrypt_regexp_cookies_no_env.ini | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | sp.global.secret_key("abcdef"); | ||
| 2 | sp.cookie.name_r("^super_co[a-z]+$").encrypt(); | ||
diff --git a/src/tests/cookies_encryption_warning/config/encrypt_regexp_cookies_no_key.ini b/src/tests/cookies_encryption_warning/config/encrypt_regexp_cookies_no_key.ini new file mode 100644 index 0000000..52427f4 --- /dev/null +++ b/src/tests/cookies_encryption_warning/config/encrypt_regexp_cookies_no_key.ini | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | sp.global.cookie_env_var("TEST"); | ||
| 2 | sp.cookie.name_r("^super_co[a-z]+$").encrypt(); | ||
diff --git a/src/tests/cookies_encryption_warning/encrypt_cookies_no_env.phpt b/src/tests/cookies_encryption_warning/encrypt_cookies_no_env.phpt new file mode 100644 index 0000000..d9d9138 --- /dev/null +++ b/src/tests/cookies_encryption_warning/encrypt_cookies_no_env.phpt | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | --TEST-- | ||
| 2 | Cookie encryption - no environment variable specified | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/encrypt_cookies_no_env.ini | ||
| 7 | display_errors=1 | ||
| 8 | display_startup_errors=1 | ||
| 9 | error_reporting=E_ALL | ||
| 10 | --COOKIE-- | ||
| 11 | super_cookie=1337;awful_cookie=awful_cookie_value; | ||
| 12 | --ENV-- | ||
| 13 | return <<<EOF | ||
| 14 | REMOTE_ADDR=127.0.0.1 | ||
| 15 | EOF; | ||
| 16 | --FILE-- | ||
| 17 | <?php echo "1"; ?> | ||
| 18 | --EXPECT-- | ||
| 19 | Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 | ||
| 20 | |||
| 21 | Fatal error: [snuffleupagus][config] You're trying to use the cookie encryption featureon line 2 without having set the `.cookie_env_var` option in`sp.global`: please set it first in Unknown on line 0 | ||
diff --git a/src/tests/cookies_encryption_warning/encrypt_cookies_no_key.phpt b/src/tests/cookies_encryption_warning/encrypt_cookies_no_key.phpt new file mode 100644 index 0000000..3eb726e --- /dev/null +++ b/src/tests/cookies_encryption_warning/encrypt_cookies_no_key.phpt | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | --TEST-- | ||
| 2 | Cookie encryption - no encryption key specified | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/encrypt_cookies_no_key.ini | ||
| 7 | display_errors=1 | ||
| 8 | display_startup_errors=1 | ||
| 9 | error_reporting=E_ALL | ||
| 10 | --COOKIE-- | ||
| 11 | super_cookie=1337;awful_cookie=awful_cookie_value; | ||
| 12 | --ENV-- | ||
| 13 | return <<<EOF | ||
| 14 | REMOTE_ADDR=127.0.0.1 | ||
| 15 | EOF; | ||
| 16 | --FILE-- | ||
| 17 | <?php echo "1"; ?> | ||
| 18 | --EXPECT-- | ||
| 19 | Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 | ||
| 20 | |||
| 21 | Fatal error: [snuffleupagus][config] You're trying to use the cookie encryption featureon line 2 without having set the `.encryption_key` option in`sp.global`: please set it first in Unknown on line 0 | ||
diff --git a/src/tests/cookies_encryption_warning/encrypt_regexp_cookies_no_env.phpt b/src/tests/cookies_encryption_warning/encrypt_regexp_cookies_no_env.phpt new file mode 100644 index 0000000..0c0dea5 --- /dev/null +++ b/src/tests/cookies_encryption_warning/encrypt_regexp_cookies_no_env.phpt | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | --TEST-- | ||
| 2 | Cookie encryption - no environment variable specified | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/encrypt_regexp_cookies_no_env.ini | ||
| 7 | display_errors=1 | ||
| 8 | display_startup_errors=1 | ||
| 9 | error_reporting=E_ALL | ||
| 10 | --COOKIE-- | ||
| 11 | super_cookie=1337;awful_cookie=awful_cookie_value; | ||
| 12 | --ENV-- | ||
| 13 | return <<<EOF | ||
| 14 | REMOTE_ADDR=127.0.0.1 | ||
| 15 | EOF; | ||
| 16 | --FILE-- | ||
| 17 | <?php echo "1"; ?> | ||
| 18 | --EXPECT-- | ||
| 19 | Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 | ||
| 20 | |||
| 21 | Fatal error: [snuffleupagus][config] You're trying to use the cookie encryption featureon line 2 without having set the `.cookie_env_var` option in`sp.global`: please set it first in Unknown on line 0 | ||
diff --git a/src/tests/cookies_encryption_warning/encrypt_regexp_cookies_no_key.phpt b/src/tests/cookies_encryption_warning/encrypt_regexp_cookies_no_key.phpt new file mode 100644 index 0000000..1877dd6 --- /dev/null +++ b/src/tests/cookies_encryption_warning/encrypt_regexp_cookies_no_key.phpt | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | --TEST-- | ||
| 2 | Cookie encryption - no encryption key specified | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/encrypt_regexp_cookies_no_key.ini | ||
| 7 | display_errors=1 | ||
| 8 | display_startup_errors=1 | ||
| 9 | error_reporting=E_ALL | ||
| 10 | --COOKIE-- | ||
| 11 | super_cookie=1337;awful_cookie=awful_cookie_value; | ||
| 12 | --ENV-- | ||
| 13 | return <<<EOF | ||
| 14 | REMOTE_ADDR=127.0.0.1 | ||
| 15 | EOF; | ||
| 16 | --FILE-- | ||
| 17 | <?php echo "1"; ?> | ||
| 18 | --EXPECT-- | ||
| 19 | Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 | ||
| 20 | |||
| 21 | Fatal error: [snuffleupagus][config] You're trying to use the cookie encryption featureon line 2 without having set the `.encryption_key` option in`sp.global`: please set it first in Unknown on line 0 | ||
