summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2011-01-24 02:48:15 +0000
committerStanislav Malyshev <stas@php.net>2011-01-24 02:48:15 +0000
commit68512f85c40542fe421995a7d85b08c5ba1edd89 (patch)
tree932183be9329d5f4d4403105bf42b834e6b3a98c
parent1a8b87d2c5c642cc1ba08e0fc75fd4bcc4393292 (diff)
downloadphp-git-68512f85c40542fe421995a7d85b08c5ba1edd89.tar.gz
fix tests
-rw-r--r--ext/date/tests/DateTime_construct_variation2.phpt38
-rw-r--r--ext/date/tests/date_create_variation2.phpt44
-rw-r--r--ext/date/tests/dateinterval_errors.phpt13
-rw-r--r--ext/date/tests/gmstrftime_variation22.phpt14
-rw-r--r--ext/date/tests/strftime_variation22.phpt14
5 files changed, 79 insertions, 44 deletions
diff --git a/ext/date/tests/DateTime_construct_variation2.phpt b/ext/date/tests/DateTime_construct_variation2.phpt
index 5f754ecc02..b1d80f9002 100644
--- a/ext/date/tests/DateTime_construct_variation2.phpt
+++ b/ext/date/tests/DateTime_construct_variation2.phpt
@@ -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
diff --git a/ext/date/tests/date_create_variation2.phpt b/ext/date/tests/date_create_variation2.phpt
index 25e5a2a352..c43ccb0699 100644
--- a/ext/date/tests/date_create_variation2.phpt
+++ b/ext/date/tests/date_create_variation2.phpt
@@ -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
index 505484c0cc..0000000000
--- a/ext/date/tests/dateinterval_errors.phpt
+++ /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
diff --git a/ext/date/tests/gmstrftime_variation22.phpt b/ext/date/tests/gmstrftime_variation22.phpt
index 788433562e..c8f51fc895 100644
--- a/ext/date/tests/gmstrftime_variation22.phpt
+++ b/ext/date/tests/gmstrftime_variation22.phpt
@@ -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===
diff --git a/ext/date/tests/strftime_variation22.phpt b/ext/date/tests/strftime_variation22.phpt
index 4ce99339b6..bd672b417a 100644
--- a/ext/date/tests/strftime_variation22.phpt
+++ b/ext/date/tests/strftime_variation22.phpt
@@ -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===