summaryrefslogtreecommitdiff
path: root/src/tests/cookies_encryption/encrypt_cookies_invalid_decryption.phpt
diff options
context:
space:
mode:
authorjvoisin2019-01-14 19:29:25 +0000
committerGitHub2019-01-14 19:29:25 +0000
commite79f7e3bd992c7f0915ef9afe7afb6d79740527a (patch)
treef881c25694eb00da2331a9ab280ec1c24a5662ab /src/tests/cookies_encryption/encrypt_cookies_invalid_decryption.phpt
parentc943db586ac46b686b49bdf61d8473e39dd93000 (diff)
Reorganize the testsuite
Splitting the testsuite in several components makes it easier to manage and comprehend. This was also needed some some tests aren't passing on Alpine Linux, but we still want to run as many of them as we can on this platform.
Diffstat (limited to 'src/tests/cookies_encryption/encrypt_cookies_invalid_decryption.phpt')
-rw-r--r--src/tests/cookies_encryption/encrypt_cookies_invalid_decryption.phpt26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/tests/cookies_encryption/encrypt_cookies_invalid_decryption.phpt b/src/tests/cookies_encryption/encrypt_cookies_invalid_decryption.phpt
new file mode 100644
index 0000000..d4a0b0f
--- /dev/null
+++ b/src/tests/cookies_encryption/encrypt_cookies_invalid_decryption.phpt
@@ -0,0 +1,26 @@
1--TEST--
2Cookie encryption - invalid decryption
3--SKIPIF--
4<?php if (!extension_loaded("snuffleupagus")) die "skip"; ?>
5--INI--
6sp.configuration_file={PWD}/config/config_encrypted_cookies.ini
7display_errors=1
8display_startup_errors=1
9error_reporting=E_ALL
10--COOKIE--
11super_cookie=Wk9NR1RISVNJU05PVEVOQ1JZUFRFREFUQUxMV0hBVFRIRUhFTExJU0hIRUxMQVJFWU9VRE9JTkdaT01Hb2htYXliZXRoaXNpc2Fub2xkc2Vzc2lvbmNvb2tpZQo=;awfulcookie=awfulcookievalue;
12--ENV--
13return <<<EOF
14REMOTE_ADDR=127.0.0.1
15EOF;
16--FILE--
17<?php
18echo "1337\n";
19var_dump($_COOKIE); ?>
20--EXPECT--
21Warning: [snuffleupagus][cookie_encryption] Something went wrong with the decryption of super_cookie in Unknown on line 0
221337
23array(1) {
24 ["awfulcookie"]=>
25 string(16) "awfulcookievalue"
26}