diff options
| author | jvoisin | 2019-01-14 19:29:25 +0000 |
|---|---|---|
| committer | GitHub | 2019-01-14 19:29:25 +0000 |
| commit | e79f7e3bd992c7f0915ef9afe7afb6d79740527a (patch) | |
| tree | f881c25694eb00da2331a9ab280ec1c24a5662ab /src/tests/session_encryption/crypt_session_valid_simul.phpt | |
| parent | c943db586ac46b686b49bdf61d8473e39dd93000 (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/session_encryption/crypt_session_valid_simul.phpt')
| -rw-r--r-- | src/tests/session_encryption/crypt_session_valid_simul.phpt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/tests/session_encryption/crypt_session_valid_simul.phpt b/src/tests/session_encryption/crypt_session_valid_simul.phpt new file mode 100644 index 0000000..28083cf --- /dev/null +++ b/src/tests/session_encryption/crypt_session_valid_simul.phpt | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | --TEST-- | ||
| 2 | SESSION crypt/decrypt valid | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/config_crypt_session_simul.ini | ||
| 7 | --ENV-- | ||
| 8 | return <<<EOF | ||
| 9 | REMOTE_ADDR=127.0.0.1 | ||
| 10 | EOF; | ||
| 11 | --FILE-- | ||
| 12 | <?php | ||
| 13 | // Do it like that to write (encrypt) the session and then to read (decrypt) the session | ||
| 14 | session_start(); // Start new_session , it will read an empty session | ||
| 15 | $_SESSION["toto"] = "tata"; // Encrypt and write the session | ||
| 16 | $id = session_id(); // Get the session_id to use it later | ||
| 17 | session_write_close(); // Close the session | ||
| 18 | |||
| 19 | session_id($id); // Recover the session with the previous session_id | ||
| 20 | session_start(); // Re start the session, It will read and decrypt the non empty session | ||
| 21 | var_dump($_SESSION); // Dump the session | ||
| 22 | ?> | ||
| 23 | --EXPECTF-- | ||
| 24 | array(1) { | ||
| 25 | ["toto"]=> | ||
| 26 | string(4) "tata" | ||
| 27 | } | ||
