From e79f7e3bd992c7f0915ef9afe7afb6d79740527a Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 14 Jan 2019 19:29:25 +0000 Subject: 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.--- .../config/encrypt_cookies_no_env.ini | 2 ++ .../config/encrypt_cookies_no_key.ini | 2 ++ .../config/encrypt_regexp_cookies_no_env.ini | 2 ++ .../config/encrypt_regexp_cookies_no_key.ini | 2 ++ .../encrypt_cookies_no_env.phpt | 21 +++++++++++++++++++++ .../encrypt_cookies_no_key.phpt | 21 +++++++++++++++++++++ .../encrypt_regexp_cookies_no_env.phpt | 21 +++++++++++++++++++++ .../encrypt_regexp_cookies_no_key.phpt | 21 +++++++++++++++++++++ 8 files changed, 92 insertions(+) create mode 100644 src/tests/cookies_encryption_warning/config/encrypt_cookies_no_env.ini create mode 100644 src/tests/cookies_encryption_warning/config/encrypt_cookies_no_key.ini create mode 100644 src/tests/cookies_encryption_warning/config/encrypt_regexp_cookies_no_env.ini create mode 100644 src/tests/cookies_encryption_warning/config/encrypt_regexp_cookies_no_key.ini create mode 100644 src/tests/cookies_encryption_warning/encrypt_cookies_no_env.phpt create mode 100644 src/tests/cookies_encryption_warning/encrypt_cookies_no_key.phpt create mode 100644 src/tests/cookies_encryption_warning/encrypt_regexp_cookies_no_env.phpt create mode 100644 src/tests/cookies_encryption_warning/encrypt_regexp_cookies_no_key.phpt (limited to 'src/tests/cookies_encryption_warning') 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 @@ +sp.global.secret_key("abcdef"); +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 @@ +sp.global.cookie_env_var("TEST"); +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 @@ +sp.global.secret_key("abcdef"); +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 @@ +sp.global.cookie_env_var("TEST"); +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 @@ +--TEST-- +Cookie encryption - no environment variable specified +--SKIPIF-- + +--INI-- +sp.configuration_file={PWD}/config/encrypt_cookies_no_env.ini +display_errors=1 +display_startup_errors=1 +error_reporting=E_ALL +--COOKIE-- +super_cookie=1337;awful_cookie=awful_cookie_value; +--ENV-- +return << +--EXPECT-- +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 + +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 @@ +--TEST-- +Cookie encryption - no encryption key specified +--SKIPIF-- + +--INI-- +sp.configuration_file={PWD}/config/encrypt_cookies_no_key.ini +display_errors=1 +display_startup_errors=1 +error_reporting=E_ALL +--COOKIE-- +super_cookie=1337;awful_cookie=awful_cookie_value; +--ENV-- +return << +--EXPECT-- +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 + +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 @@ +--TEST-- +Cookie encryption - no environment variable specified +--SKIPIF-- + +--INI-- +sp.configuration_file={PWD}/config/encrypt_regexp_cookies_no_env.ini +display_errors=1 +display_startup_errors=1 +error_reporting=E_ALL +--COOKIE-- +super_cookie=1337;awful_cookie=awful_cookie_value; +--ENV-- +return << +--EXPECT-- +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 + +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 @@ +--TEST-- +Cookie encryption - no encryption key specified +--SKIPIF-- + +--INI-- +sp.configuration_file={PWD}/config/encrypt_regexp_cookies_no_key.ini +display_errors=1 +display_startup_errors=1 +error_reporting=E_ALL +--COOKIE-- +super_cookie=1337;awful_cookie=awful_cookie_value; +--ENV-- +return << +--EXPECT-- +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 + +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 -- cgit v1.3