php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch 61786.diff for Session related Bug #61786

Patch version 2012-04-20 10:22 UTC

Return to Bug #61786 | Download this patch
Patch Revisions:

Developer: ab@php.net

diff --git a/ext/session/tests/rfc1867_invalid_settings.phpt b/ext/session/tests/rfc1867_invalid_settings.phpt
index d954563..640c4d2 100644
--- a/ext/session/tests/rfc1867_invalid_settings.phpt
+++ b/ext/session/tests/rfc1867_invalid_settings.phpt
@@ -4,7 +4,11 @@ session rfc1867 invalid settings
 session.upload_progress.freq=-1
 error_log=
 --SKIPIF--
-<?php include('skipif.inc'); ?>
+<?php 
+include('skipif.inc');
+if(substr(PHP_OS, 0, 3) == "WIN")
+        die("skip Not for Windows");
+?>
 --FILE--
 <?php
 var_dump(ini_get("session.upload_progress.freq"));
diff --git a/ext/session/tests/rfc1867_invalid_settings_2.phpt b/ext/session/tests/rfc1867_invalid_settings_2.phpt
index 544510e..c2a0c6a 100644
--- a/ext/session/tests/rfc1867_invalid_settings_2.phpt
+++ b/ext/session/tests/rfc1867_invalid_settings_2.phpt
@@ -4,7 +4,11 @@ session rfc1867 invalid settings 2
 session.upload_progress.freq=200%
 error_log=
 --SKIPIF--
-<?php include('skipif.inc'); ?>
+<?php 
+include('skipif.inc');
+if(substr(PHP_OS, 0, 3) == "WIN")
+        die("skip Not for Windows");
+?>
 --FILE--
 <?php
 var_dump(ini_get("session.upload_progress.freq"));
diff --git a/ext/session/tests/session_set_save_handler_class_002.phpt b/ext/session/tests/session_set_save_handler_class_002.phpt
index 9d5f732..6fb831f 100644
--- a/ext/session/tests/session_set_save_handler_class_002.phpt
+++ b/ext/session/tests/session_set_save_handler_class_002.phpt
@@ -23,7 +23,7 @@ class MySession2 extends SessionHandler {
 
 	public function open($path, $name) {
 		if (!$path) {
-			$path = '/tmp';
+			$path = sys_get_temp_dir();
 		}
 		$this->path = $path . '/u_sess_' . $name;
 		return true;
diff --git a/ext/session/tests/session_set_save_handler_iface_001.phpt b/ext/session/tests/session_set_save_handler_iface_001.phpt
index c8199ff..39a4b99 100644
--- a/ext/session/tests/session_set_save_handler_iface_001.phpt
+++ b/ext/session/tests/session_set_save_handler_iface_001.phpt
@@ -23,7 +23,7 @@ class MySession2 implements SessionHandlerInterface {
 
 	public function open($path, $name) {
 		if (!$path) {
-			$path = '/tmp';
+			$path = sys_get_temp_dir();
 		}
 		$this->path = $path . '/u_sess_' . $name;
 		return true;
diff --git a/ext/session/tests/session_set_save_handler_iface_002.phpt b/ext/session/tests/session_set_save_handler_iface_002.phpt
index 42e8fbe..40c9ac6 100644
--- a/ext/session/tests/session_set_save_handler_iface_002.phpt
+++ b/ext/session/tests/session_set_save_handler_iface_002.phpt
@@ -32,7 +32,7 @@ class MySession2 implements MySessionHandlerInterface {
 
 	public function open($path, $name) {
 		if (!$path) {
-			$path = '/tmp';
+			$path = sys_get_temp_dir();
 		}
 		$this->path = $path . '/u_sess_' . $name;
 		return true;
--- a/ext/session/tests/rfc1867_invalid_settings-win.phpt
+++ b/ext/session/tests/rfc1867_invalid_settings-win.phpt
@@ -0,0 +1,19 @@
+--TEST--
+session rfc1867 invalid settings
+--INI--
+session.upload_progress.freq=-1
+error_log=
+--SKIPIF--
+<?php 
+include('skipif.inc');
+if(substr(PHP_OS, 0, 3) != "WIN")
+        die("skip windows only test");
+?>
+--FILE--
+<?php
+var_dump(ini_get("session.upload_progress.freq"));
+?>
+--EXPECTF--
+Warning: PHP Startup: session.upload_progress.freq must be greater than or equal to zero in %s
+string(2) "1%"
+PHP Warning:  PHP Startup: session.upload_progress.freq must be greater than or equal to zero in %s
--- a/ext/session/tests/rfc1867_invalid_settings_2-win.phpt
+++ b/ext/session/tests/rfc1867_invalid_settings_2-win.phpt
@@ -0,0 +1,19 @@
+--TEST--
+session rfc1867 invalid settings 2
+--INI--
+session.upload_progress.freq=200%
+error_log=
+--SKIPIF--
+<?php 
+include('skipif.inc');
+if(substr(PHP_OS, 0, 3) != "WIN")
+        die("skip windows only test");
+?>
+--FILE--
+<?php
+var_dump(ini_get("session.upload_progress.freq"));
+?>
+--EXPECTF--
+Warning: PHP Startup: session.upload_progress.freq cannot be over 100% in %s
+string(2) "1%"
+PHP Warning:  PHP Startup: session.upload_progress.freq cannot be over 100% in %s
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jun 04 06:01:35 2024 UTC