summaryrefslogtreecommitdiff
path: root/src/tests/cookies_encryption_warning
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/cookies_encryption_warning')
-rw-r--r--src/tests/cookies_encryption_warning/config/encrypt_cookies_no_env.ini2
-rw-r--r--src/tests/cookies_encryption_warning/config/encrypt_cookies_no_key.ini2
-rw-r--r--src/tests/cookies_encryption_warning/config/encrypt_regexp_cookies_no_env.ini2
-rw-r--r--src/tests/cookies_encryption_warning/config/encrypt_regexp_cookies_no_key.ini2
-rw-r--r--src/tests/cookies_encryption_warning/encrypt_cookies_no_env.phpt21
-rw-r--r--src/tests/cookies_encryption_warning/encrypt_cookies_no_key.phpt21
-rw-r--r--src/tests/cookies_encryption_warning/encrypt_regexp_cookies_no_env.phpt21
-rw-r--r--src/tests/cookies_encryption_warning/encrypt_regexp_cookies_no_key.phpt21
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 @@
1sp.global.secret_key("abcdef");
2sp.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 @@
1sp.global.cookie_env_var("TEST");
2sp.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 @@
1sp.global.secret_key("abcdef");
2sp.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 @@
1sp.global.cookie_env_var("TEST");
2sp.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--
2Cookie encryption - no environment variable specified
3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) die "skip"; ?>
5--INI--
6sp.configuration_file={PWD}/config/encrypt_cookies_no_env.ini
7display_errors=1
8display_startup_errors=1
9error_reporting=E_ALL
10--COOKIE--
11super_cookie=1337;awful_cookie=awful_cookie_value;
12--ENV--
13return <<<EOF
14REMOTE_ADDR=127.0.0.1
15EOF;
16--FILE--
17<?php echo "1"; ?>
18--EXPECT--
19Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0
20
21Fatal 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--
2Cookie encryption - no encryption key specified
3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) die "skip"; ?>
5--INI--
6sp.configuration_file={PWD}/config/encrypt_cookies_no_key.ini
7display_errors=1
8display_startup_errors=1
9error_reporting=E_ALL
10--COOKIE--
11super_cookie=1337;awful_cookie=awful_cookie_value;
12--ENV--
13return <<<EOF
14REMOTE_ADDR=127.0.0.1
15EOF;
16--FILE--
17<?php echo "1"; ?>
18--EXPECT--
19Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0
20
21Fatal 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--
2Cookie encryption - no environment variable specified
3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) die "skip"; ?>
5--INI--
6sp.configuration_file={PWD}/config/encrypt_regexp_cookies_no_env.ini
7display_errors=1
8display_startup_errors=1
9error_reporting=E_ALL
10--COOKIE--
11super_cookie=1337;awful_cookie=awful_cookie_value;
12--ENV--
13return <<<EOF
14REMOTE_ADDR=127.0.0.1
15EOF;
16--FILE--
17<?php echo "1"; ?>
18--EXPECT--
19Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0
20
21Fatal 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--
2Cookie encryption - no encryption key specified
3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) die "skip"; ?>
5--INI--
6sp.configuration_file={PWD}/config/encrypt_regexp_cookies_no_key.ini
7display_errors=1
8display_startup_errors=1
9error_reporting=E_ALL
10--COOKIE--
11super_cookie=1337;awful_cookie=awful_cookie_value;
12--ENV--
13return <<<EOF
14REMOTE_ADDR=127.0.0.1
15EOF;
16--FILE--
17<?php echo "1"; ?>
18--EXPECT--
19Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0
20
21Fatal 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