From 00daa2e8630f6b057c466ea5462364a0a522ca8f Mon Sep 17 00:00:00 2001 From: jvoisin Date: Tue, 9 Oct 2018 16:25:02 +0200 Subject: Bump coverage --- src/tests/broken_conf_session_encryption.phpt | 14 ++++++++++++++ ...ken_conf_session_encryption_without_encryption_key.phpt | 14 ++++++++++++++ .../broken_conf_session_encryption_without_env_var.phpt | 14 ++++++++++++++ src/tests/config/broken_conf_session_encryption.ini | 1 + ...oken_conf_session_encryption_without_encryption_key.ini | 2 ++ .../broken_conf_session_encryption_without_env_var.ini | 2 ++ 6 files changed, 47 insertions(+) create mode 100644 src/tests/broken_conf_session_encryption.phpt create mode 100644 src/tests/broken_conf_session_encryption_without_encryption_key.phpt create mode 100644 src/tests/broken_conf_session_encryption_without_env_var.phpt create mode 100644 src/tests/config/broken_conf_session_encryption.ini create mode 100644 src/tests/config/broken_conf_session_encryption_without_encryption_key.ini create mode 100644 src/tests/config/broken_conf_session_encryption_without_env_var.ini (limited to 'src') diff --git a/src/tests/broken_conf_session_encryption.phpt b/src/tests/broken_conf_session_encryption.phpt new file mode 100644 index 0000000..b6a0ea7 --- /dev/null +++ b/src/tests/broken_conf_session_encryption.phpt @@ -0,0 +1,14 @@ +--TEST-- +Broken config, session encryption +--SKIPIF-- + +--INI-- +sp.configuration_file={PWD}/config/broken_conf_session_encryption.ini +--FILE-- +--EXPECT-- +PHP Fatal error: [snuffleupagus][config] Trailing chars 'nvalid value :/);' at the end of '.encrypt(invalid value :/);' on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Trailing chars 'nvalid value :/);' at the end of '.encrypt(invalid value :/);' on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. diff --git a/src/tests/broken_conf_session_encryption_without_encryption_key.phpt b/src/tests/broken_conf_session_encryption_without_encryption_key.phpt new file mode 100644 index 0000000..c90a154 --- /dev/null +++ b/src/tests/broken_conf_session_encryption_without_encryption_key.phpt @@ -0,0 +1,14 @@ +--TEST-- +Broken configuration - encrypted session without encryption key +--SKIPIF-- + +--INI-- +sp.configuration_file={PWD}/config/broken_conf_session_encryption_without_encryption_key.ini +--FILE-- +--EXPECT-- +PHP Fatal error: [snuffleupagus][config] You're trying to use the session cookie encryption feature on line 2 without having set the `.secret_key` option in`sp.global`: please set it first in Unknown on line 0 + +Fatal error: [snuffleupagus][config] You're trying to use the session cookie encryption feature on line 2 without having set the `.secret_key` option in`sp.global`: please set it first in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. diff --git a/src/tests/broken_conf_session_encryption_without_env_var.phpt b/src/tests/broken_conf_session_encryption_without_env_var.phpt new file mode 100644 index 0000000..c2654e4 --- /dev/null +++ b/src/tests/broken_conf_session_encryption_without_env_var.phpt @@ -0,0 +1,14 @@ +--TEST-- +Broken configuration - encrypted session without env var +--SKIPIF-- + +--INI-- +sp.configuration_file={PWD}/config/broken_conf_session_encryption_without_env_var.ini +--FILE-- +--EXPECT-- +PHP Fatal error: [snuffleupagus][config] You're trying to use the session cookie encryption feature on line 2 without having set the `.cookie_env_var` option in`sp.global`: please set it first in Unknown on line 0 + +Fatal error: [snuffleupagus][config] You're trying to use the session cookie encryption feature on line 2 without having set the `.cookie_env_var` option in`sp.global`: please set it first in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. diff --git a/src/tests/config/broken_conf_session_encryption.ini b/src/tests/config/broken_conf_session_encryption.ini new file mode 100644 index 0000000..66b7956 --- /dev/null +++ b/src/tests/config/broken_conf_session_encryption.ini @@ -0,0 +1 @@ +sp.session.encrypt(invalid value :/); diff --git a/src/tests/config/broken_conf_session_encryption_without_encryption_key.ini b/src/tests/config/broken_conf_session_encryption_without_encryption_key.ini new file mode 100644 index 0000000..2b6f674 --- /dev/null +++ b/src/tests/config/broken_conf_session_encryption_without_encryption_key.ini @@ -0,0 +1,2 @@ +sp.global.cookie_env_var("MY_SUPER_ENV_VAR_YAY"); +sp.session.encrypt(); diff --git a/src/tests/config/broken_conf_session_encryption_without_env_var.ini b/src/tests/config/broken_conf_session_encryption_without_env_var.ini new file mode 100644 index 0000000..43caf4a --- /dev/null +++ b/src/tests/config/broken_conf_session_encryption_without_env_var.ini @@ -0,0 +1,2 @@ +sp.global.secret_key("super secret key, shhhh"); +sp.session.encrypt(); -- cgit v1.3