]> granicus.if.org Git - php/commitdiff
test fixes on Darwin
authorStanislav Malyshev <stas@php.net>
Wed, 31 Aug 2011 07:10:17 +0000 (07:10 +0000)
committerStanislav Malyshev <stas@php.net>
Wed, 31 Aug 2011 07:10:17 +0000 (07:10 +0000)
ext/date/tests/bug33532.phpt
ext/date/tests/gmstrftime_variation22.phpt
ext/date/tests/strftime_variation22.phpt
ext/standard/tests/math/bug45712.phpt
ext/standard/tests/strings/nl_langinfo_variation1.phpt
ext/standard/tests/strings/strtolower.phpt
ext/standard/tests/strings/strtoupper1.phpt

index 286ceb4cec0180cd5c341d451c145e60c00f5b0d..5c88e73acde9b5aff45b5794d41e2672ddaff7eb 100644 (file)
@@ -3,6 +3,9 @@ Bug #33532 (Different output for strftime() and date())
 --INI--
 error_reporting=2047
 date.timezone=UTC
+--SKIPIF--
+<?php
+if(PHP_OS == 'Darwin') die("skip strftime depends on TZ on Darwin");
 --FILE--
 <?php
 
@@ -18,6 +21,7 @@ print "datestr  " . date ("H:i:s A F j Y T", $tStamp) . "\n";
 
 print "\nSetting TZ\n";
 date_default_timezone_set('Australia/Sydney');
+putenv("TZ=Australia/Sydney");
 $input = "10:00:00 AM July 1 2005";
 print "input    " . $input . "\n";
 $tStamp = strtotime($input);
index 198941871c5818d606ba1cf9b1b6fc05e639c13d..d9abdce17af36aeafcd0e9991163c0ac6afd7c31 100644 (file)
@@ -5,8 +5,8 @@ Test gmstrftime() function : usage variation - Checking Preferred date and time
 if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
     die("skip Test is not valid for Windows");
 }
-if (!setlocale(LC_ALL, "en_US.utf8", "en_US")) {
-    die("skip Locale en_US or en_US.utf8 is required to run this test");
+if (!setlocale(LC_TIME, "POSIX")) {
+    die("skip Locale POSIX is required to run this test");
 }
 ?>
 --FILE--
@@ -21,7 +21,8 @@ echo "*** Testing gmstrftime() : usage variation ***\n";
 
 // Initialise function arguments not being substituted (if any)
 $timestamp = gmmktime(8, 8, 8, 8, 8, 2008);
-setlocale(LC_ALL, "en_US.utf8", "en_US");
+setlocale(LC_TIME, "POSIX");
+putenv("LC_TIME=POSIX");
 date_default_timezone_set("Asia/Calcutta");
 
 //array of values to iterate over
@@ -46,13 +47,13 @@ foreach($inputs as $key =>$value) {
 
 --Preferred date and time representation--
 string(2) "%c"
-string(31) "Fri 08 Aug 2008 08:08:08 AM GMT"
+string(24) "Fri Aug  8 08:08:08 2008"
 
 --Preferred date representation--
 string(2) "%x"
-string(10) "08/08/2008"
+string(8) "08/08/08"
 
 --Preferred time representation--
 string(2) "%X"
-string(11) "08:08:08 AM"
+string(8) "08:08:08"
 ===DONE===
index 151a7d20673a6e578198443d7d6a99de3e79a0f4..7b72ca51e1e4083523aff52b73d57c02c37cd93e 100644 (file)
@@ -5,8 +5,8 @@ Test strftime() function : usage variation - Checking Preferred date and time re
 if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
     die("skip Test is not valid for Windows");
 }
-if(!setlocale(LC_ALL, "en_US.utf8", "en_US")) {
-       die("skip Locale en_US.utf8 or en_US is  needed by test and is not available");
+if(!setlocale(LC_ALL, "POSIX")) {
+       die("skip Locale POSIX is  needed by test and is not available");
 }
 ?>
 --FILE--
@@ -20,7 +20,8 @@ if(!setlocale(LC_ALL, "en_US.utf8", "en_US")) {
 echo "*** Testing strftime() : usage variation ***\n";
 
 // Initialise function arguments not being substituted (if any)
-setlocale(LC_ALL, "en_US.utf8", "en_US");
+setlocale(LC_ALL, "POSIX");
+putenv("LC_ALL=POSIX");
 date_default_timezone_set("Asia/Calcutta");
 $timestamp = mktime(8, 8, 8, 8, 8, 2008);
 
@@ -46,13 +47,13 @@ foreach($inputs as $key =>$value) {
 
 --Preferred date and time representation--
 string(2) "%c"
-string(31) "Fri 08 Aug 2008 08:08:08 AM IST"
+string(24) "Fri Aug  8 08:08:08 2008"
 
 --Preferred date representation--
 string(2) "%x"
-string(10) "08/08/2008"
+string(8) "08/08/08"
 
 --Preferred time representation--
 string(2) "%X"
-string(11) "08:08:08 AM"
+string(8) "08:08:08"
 ===DONE===
index 3ebc94c92e79cc84c638f2f71a7d8aa640340d0d..e10d0e7ec398dfceaf40a8a6605453cecd06e7e7 100644 (file)
@@ -1,5 +1,7 @@
 --TEST--
 Bug #45712 (NaN/INF comparison)
+--XFAIL--
+Bug 45712 not fixed yet.
 --FILE--
 <?php
 
index 41844697f114d68d5e05e52a0d83d661b676289c..98edb1ba1c90dd21a2cfd90ce18f6f2728cf485a 100644 (file)
@@ -34,46 +34,22 @@ $file_handle = fopen(__FILE__, "r");
 
 // array with different values for $input
 $items =  array (
-
                  // integer values
-/*1*/    0,
-                 10,
-             2147483647,
+/*1*/    2147483647,
                  -2147483648,
+                 -20,
                
-                 // float values
-/*5*/    10.5,
-                 20.3,
-                 -20.5,
-                 10.1234567e5,
-               
-                 // array values
-/*9*/    array(),
+             // array values
+/*4*/    array(),
                  array(0),
                  array(1, 2),
                
-                 // boolean values
-/*12*/   true,
-                 false,
-                 TRUE,
-                 FALSE,
-               
-                 // null vlaues
-/*16*/   NULL,
-                 null,
-               
                  // objects
-/*18*/   new sample(),
+/*7*/    new sample(),
                
                  // resource
-/*19*/   $file_handle,
-               
-                 // undefined variable
-/*20*/   @$undefined_var,
-               
-                 // unset variable
-/*21*/   @$unset_var
-);
+/*8*/    $file_handle,
+               );
 
 //defining '$input' argument
 $input = "Test string";
@@ -95,86 +71,34 @@ setlocale(LC_ALL, $original);
 *** Testing nl_langinfo() : with unexpected inputs for 'item' argument ***
 -- Iteration 1 --
 
-Warning: nl_langinfo(): Item '0' is not valid in %s on line %d
-bool(false)
--- Iteration 2 --
-
-Warning: nl_langinfo(): Item '10' is not valid in %s on line %d
-bool(false)
--- Iteration 3 --
-
 Warning: nl_langinfo(): Item '2147483647' is not valid in %s on line %d
 bool(false)
--- Iteration 4 --
+-- Iteration 2 --
 
 Warning: nl_langinfo(): Item '-2147483648' is not valid in %s on line %d
 bool(false)
--- Iteration 5 --
-
-Warning: nl_langinfo(): Item '10' is not valid in %s on line %d
-bool(false)
--- Iteration 6 --
-
-Warning: nl_langinfo(): Item '20' is not valid in %s on line %d
-bool(false)
--- Iteration 7 --
+-- Iteration 3 --
 
 Warning: nl_langinfo(): Item '-20' is not valid in %s on line %d
 bool(false)
--- Iteration 8 --
-
-Warning: nl_langinfo(): Item '1012345' is not valid in %s on line %d
-bool(false)
--- Iteration 9 --
+-- Iteration 4 --
 
 Warning: nl_langinfo() expects parameter 1 to be long, array given in %s on line %d
 NULL
--- Iteration 10 --
+-- Iteration 5 --
 
 Warning: nl_langinfo() expects parameter 1 to be long, array given in %s on line %d
 NULL
--- Iteration 11 --
+-- Iteration 6 --
 
 Warning: nl_langinfo() expects parameter 1 to be long, array given in %s on line %d
 NULL
--- Iteration 12 --
-
-Warning: nl_langinfo(): Item '1' is not valid in %s on line %d
-bool(false)
--- Iteration 13 --
-
-Warning: nl_langinfo(): Item '0' is not valid in %s on line %d
-bool(false)
--- Iteration 14 --
-
-Warning: nl_langinfo(): Item '1' is not valid in %s on line %d
-bool(false)
--- Iteration 15 --
-
-Warning: nl_langinfo(): Item '0' is not valid in %s on line %d
-bool(false)
--- Iteration 16 --
-
-Warning: nl_langinfo(): Item '0' is not valid in %s on line %d
-bool(false)
--- Iteration 17 --
-
-Warning: nl_langinfo(): Item '0' is not valid in %s on line %d
-bool(false)
--- Iteration 18 --
+-- Iteration 7 --
 
 Warning: nl_langinfo() expects parameter 1 to be long, object given in %s on line %d
 NULL
--- Iteration 19 --
+-- Iteration 8 --
 
 Warning: nl_langinfo() expects parameter 1 to be long, resource given in %s on line %d
 NULL
--- Iteration 20 --
-
-Warning: nl_langinfo(): Item '0' is not valid in %s on line %d
-bool(false)
--- Iteration 21 --
-
-Warning: nl_langinfo(): Item '0' is not valid in %s on line %d
-bool(false)
 ===DONE===
index f498a95f791e247072e1241ab42a74c7d1a21885..166b5ccc67714ee8715331780c929569fa3f3e6c 100644 (file)
Binary files a/ext/standard/tests/strings/strtolower.phpt and b/ext/standard/tests/strings/strtolower.phpt differ
index 2890c02ccdae7924e74937a526a8381f91c04efd..b83a8a3a5d4476fe05efc36956fca7622627a916 100644 (file)
Binary files a/ext/standard/tests/strings/strtoupper1.phpt and b/ext/standard/tests/strings/strtoupper1.phpt differ