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/cookies_encryption/setcookie.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/cookies_encryption/setcookie.phpt')
| -rw-r--r-- | src/tests/cookies_encryption/setcookie.phpt | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/tests/cookies_encryption/setcookie.phpt b/src/tests/cookies_encryption/setcookie.phpt new file mode 100644 index 0000000..ba1d1c1 --- /dev/null +++ b/src/tests/cookies_encryption/setcookie.phpt | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | --TEST-- | ||
| 2 | Set cookies. | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) die "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/config_encrypted_cookies.ini | ||
| 7 | --COOKIE-- | ||
| 8 | --ENV-- | ||
| 9 | return <<<EOF | ||
| 10 | REMOTE_ADDR=127.0.0.1 | ||
| 11 | HTTP_USER_AGENT=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/59.0.3071.109 Chrome/59.0.3071.109 Safari/537.36 | ||
| 12 | HTTPS=1 | ||
| 13 | EOF; | ||
| 14 | --FILE-- | ||
| 15 | <?php | ||
| 16 | setcookie("name"); | ||
| 17 | setcookie("super_cookie"); | ||
| 18 | setcookie("name", "value"); | ||
| 19 | setcookie("name", "value1", 1); | ||
| 20 | setcookie("name", "value2", 0); | ||
| 21 | setcookie("name", "value", 1, "/super/path"); | ||
| 22 | setcookie("name", "value", 1, "/super/path", "super_domain"); | ||
| 23 | setcookie("name", "value", 1, "/super/path", "super_domain1", true); | ||
| 24 | setcookie("name", "value", 1, "/super/path", "super_domain2", false); | ||
| 25 | setcookie("name", "value", 1, "/super/path", "super_domain1", true, true); | ||
| 26 | setcookie("name", "value", 1, "/super/path", "super_domain2", true, false); | ||
| 27 | setcookie("name", "value", 1, "/super/path", "super_domain2", true, false, 1337); | ||
| 28 | setcookie(); | ||
| 29 | echo '1337'; | ||
| 30 | ?> | ||
| 31 | --EXPECTF-- | ||
| 32 | Warning: setcookie() expects at most 7 parameters, 8 given in %a/setcookie.php on line %d | ||
| 33 | |||
| 34 | Warning: setcookie() expects at least 1 parameter, 0 given in %a/setcookie.php on line %d | ||
| 35 | 1337 | ||
