]> granicus.if.org Git - php/commitdiff
fix tests
authorStanislav Malyshev <stas@php.net>
Mon, 24 Jan 2011 02:48:15 +0000 (02:48 +0000)
committerStanislav Malyshev <stas@php.net>
Mon, 24 Jan 2011 02:48:15 +0000 (02:48 +0000)
ext/date/tests/DateTime_construct_variation2.phpt
ext/date/tests/date_create_variation2.phpt
ext/date/tests/dateinterval_errors.phpt [deleted file]
ext/date/tests/gmstrftime_variation22.phpt
ext/date/tests/strftime_variation22.phpt

index 5f754ecc0249f351a577a71a52da956b6f87bc5f..b1d80f90023e2b241222e71f5192544600c45587 100644 (file)
@@ -114,7 +114,7 @@ fclose( $file_handle);
 
 ?>
 ===DONE===
---EXPECT--
+--EXPECTF--
 *** Testing new DateTime() : usage variation -  unexpected values to second argument $timezone***
 
 -- int 0 --
@@ -151,10 +151,24 @@ FAILED: DateTime::__construct() expects parameter 2 to be DateTimeZone, array gi
 FAILED: DateTime::__construct() expects parameter 2 to be DateTimeZone, array given
 
 -- uppercase NULL --
-FAILED: DateTime::__construct() expects parameter 2 to be DateTimeZone, null given
+object(DateTime)#%d (3) {
+  ["date"]=>
+  string(19) "2005-07-14 22:30:41"
+  ["timezone_type"]=>
+  int(3)
+  ["timezone"]=>
+  string(13) "Europe/London"
+}
 
 -- lowercase null --
-FAILED: DateTime::__construct() expects parameter 2 to be DateTimeZone, null given
+object(DateTime)#%d (3) {
+  ["date"]=>
+  string(19) "2005-07-14 22:30:41"
+  ["timezone_type"]=>
+  int(3)
+  ["timezone"]=>
+  string(13) "Europe/London"
+}
 
 -- lowercase true --
 FAILED: DateTime::__construct() expects parameter 2 to be DateTimeZone, boolean given
@@ -193,10 +207,24 @@ FAILED: DateTime::__construct() expects parameter 2 to be DateTimeZone, object g
 FAILED: DateTime::__construct() expects parameter 2 to be DateTimeZone, object given
 
 -- undefined var --
-FAILED: DateTime::__construct() expects parameter 2 to be DateTimeZone, null given
+object(DateTime)#%d (3) {
+  ["date"]=>
+  string(19) "2005-07-14 22:30:41"
+  ["timezone_type"]=>
+  int(3)
+  ["timezone"]=>
+  string(13) "Europe/London"
+}
 
 -- unset var --
-FAILED: DateTime::__construct() expects parameter 2 to be DateTimeZone, null given
+object(DateTime)#%d (3) {
+  ["date"]=>
+  string(19) "2005-07-14 22:30:41"
+  ["timezone_type"]=>
+  int(3)
+  ["timezone"]=>
+  string(13) "Europe/London"
+}
 
 -- resource --
 FAILED: DateTime::__construct() expects parameter 2 to be DateTimeZone, resource given
index 25e5a2a352b5c2084f4447a1b38abd2640450cf3..c43ccb06990e4b6c8d7dffc7d1de4bb190b959e9 100644 (file)
@@ -166,14 +166,24 @@ Warning: date_create() expects parameter 2 to be DateTimeZone, array given in %s
 bool(false)
 
 -- uppercase NULL --
-
-Warning: date_create() expects parameter 2 to be DateTimeZone, null given in %s on line %d
-bool(false)
+object(DateTime)#%d (3) {
+  ["date"]=>
+  string(19) "2005-07-14 22:30:41"
+  ["timezone_type"]=>
+  int(3)
+  ["timezone"]=>
+  string(13) "Europe/London"
+}
 
 -- lowercase null --
-
-Warning: date_create() expects parameter 2 to be DateTimeZone, null given in %s on line %d
-bool(false)
+object(DateTime)#%d (3) {
+  ["date"]=>
+  string(19) "2005-07-14 22:30:41"
+  ["timezone_type"]=>
+  int(3)
+  ["timezone"]=>
+  string(13) "Europe/London"
+}
 
 -- lowercase true --
 
@@ -236,14 +246,24 @@ Warning: date_create() expects parameter 2 to be DateTimeZone, object given in %
 bool(false)
 
 -- undefined var --
-
-Warning: date_create() expects parameter 2 to be DateTimeZone, null given in %s on line %d
-bool(false)
+object(DateTime)#%d (3) {
+  ["date"]=>
+  string(19) "2005-07-14 22:30:41"
+  ["timezone_type"]=>
+  int(3)
+  ["timezone"]=>
+  string(13) "Europe/London"
+}
 
 -- unset var --
-
-Warning: date_create() expects parameter 2 to be DateTimeZone, null given in %s on line %d
-bool(false)
+object(DateTime)#%d (3) {
+  ["date"]=>
+  string(19) "2005-07-14 22:30:41"
+  ["timezone_type"]=>
+  int(3)
+  ["timezone"]=>
+  string(13) "Europe/London"
+}
 
 -- resource --
 
diff --git a/ext/date/tests/dateinterval_errors.phpt b/ext/date/tests/dateinterval_errors.phpt
deleted file mode 100644 (file)
index 505484c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
---TEST--
-DateInterval: Getter and setter errors
---FILE--
-<?php
-$d = DateInterval::createFromDateString("");
-$d->y = 1984;
-var_dump($d->y);
-var_dump($d->asdf, $d->y);
-?>
---EXPECTF--
-int(1984)
-
-Fatal error: main(): Unknown property (asdf) in %sdateinterval_errors.php on line 5
index 788433562e344fd55ec4f087a67297878e326101..c8f51fc8958c8e0c94832e35137b6861833eea7b 100644 (file)
@@ -35,24 +35,24 @@ $inputs = array(
 
 foreach($inputs as $key =>$value) {
       echo "\n--$key--\n";
-      var_dump( gmstrftime($value) );
+      var_dump( $value );
       var_dump( gmstrftime($value, $timestamp) );
 };
 
 ?>
 ===DONE===
---EXPECTF--
+--EXPECT--
 *** Testing gmstrftime() : usage variation ***
 
 --Preferred date and time representation--
-string(%d) "%s %d %s %d %d:%d:%d %s GMT"
-string(31) "Fri 08 Aug 2008 08:08:08 AM GMT"
+string(2) "%c"
+string(24) "Fri Aug  8 08:08:08 2008"
 
 --Preferred date representation--
-string(%d) "%d/%d/%d"
+string(2) "%x"
 string(10) "08/08/2008"
 
 --Preferred time representation--
-string(%d) "%d:%d:%d %s"
-string(11) "08:08:08 AM"
+string(2) "%X"
+string(8) "08:08:08"
 ===DONE===
index 4ce99339b6f3b82c3933c093ae58a3c01853928a..bd672b417a5e9c2a3525c020816924a5fa3876a1 100644 (file)
@@ -35,24 +35,24 @@ $inputs = array(
 
 foreach($inputs as $key =>$value) {
       echo "\n--$key--\n";
-         var_dump( strftime($value) );
+         var_dump( $value );
          var_dump( strftime($value, $timestamp) );
 }        
 
 ?>
 ===DONE===
---EXPECTF--
+--EXPECT--
 *** Testing strftime() : usage variation ***
 
 --Preferred date and time representation--
-string(%d) "%s %d %s %d %d:%d:%d %s %s"
-string(31) "Fri 08 Aug 2008 08:08:08 AM IST"
+string(2) "%c"
+string(24) "Fri Aug  8 08:08:08 2008"
 
 --Preferred date representation--
-string(%d) "%d/%d/%d"
+string(2) "%x"
 string(10) "08/08/2008"
 
 --Preferred time representation--
-string(%d) "%d:%d:%d %s"
-string(11) "08:08:08 AM"
+string(2) "%X"
+string(8) "08:08:08"
 ===DONE===