]> granicus.if.org Git - php/commitdiff
Try to fix 32-bit setcookie tests, again
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 8 Sep 2020 15:37:40 +0000 (17:37 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 8 Sep 2020 15:38:06 +0000 (17:38 +0200)
ext/standard/tests/network/setcookie_array_option_error.phpt
ext/standard/tests/network/setrawcookie_error.phpt

index 7e564db57cb458f6e8a9c583e18dd2f133782321..eb76da180cd6fadbb97d4d583b221a1a0d646989 100644 (file)
@@ -48,7 +48,7 @@ try {
 if (PHP_INT_SIZE == 8) {
     try {
         // To go above year 9999: 60 * 60 * 24 * 365 * 9999
-        setrawcookie('name', 'value', ['expires' => 315328464000]);
+        setcookie('name', 'value', ['expires' => 315328464000]);
     } catch (\ValueError $e) {
         var_dump($e->getMessage() == 'setcookie(): "expires" option cannot have a year greater than 9999');
     }
@@ -66,7 +66,7 @@ setcookie(): option "foo" is invalid
 setcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
 setcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
 setcookie(): Expects exactly 3 arguments when argument #3 ($expires_or_options) is an array
-bool(false)
+bool(true)
 array(1) {
   [0]=>
   string(%s) "X-Powered-By: PHP/%s"
index dd428a198a5e65101a13b2374f0c596480787126..eba7b04bb03a5fb34a9b5a65ae6fc0e6219f0909 100644 (file)
@@ -22,12 +22,6 @@ try {
 } catch (\ValueError $e) {
     echo $e->getMessage() . "\n";
 }
-// To go above year 9999: 60 * 60 * 24 * 365 * 9999
-try {
-    setrawcookie('name', 'value', 315328464000);
-} catch (\ValueError $e) {
-    echo $e->getMessage() . "\n";
-}
 try {
     setrawcookie('name', 'value', 100, 'invalid;');
 } catch (\ValueError $e) {
@@ -59,7 +53,6 @@ var_dump(headers_list());
 setrawcookie(): Argument #1 ($name) cannot be empty
 setrawcookie(): Argument #1 ($name) cannot contain "=", ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
 setrawcookie(): Argument #2 ($value) cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
-setrawcookie(): "expires" option cannot have a year greater than 9999
 setrawcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
 setrawcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
 bool(true)