From 688b347d84d6df403e0448c4c9b91b95b3d8e4fd Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Sun, 28 Nov 2010 16:27:49 +0000 Subject: [PATCH] - Fixed two more test cases. --- .../tests/DateTime_modify_variation1.phpt | 232 +++++------------- ext/date/tests/date_modify_variation2.phpt | 232 +++++------------- 2 files changed, 132 insertions(+), 332 deletions(-) diff --git a/ext/date/tests/DateTime_modify_variation1.phpt b/ext/date/tests/DateTime_modify_variation1.phpt index d1c8ed46f9..e4d9067de0 100644 --- a/ext/date/tests/DateTime_modify_variation1.phpt +++ b/ext/date/tests/DateTime_modify_variation1.phpt @@ -111,44 +111,24 @@ fclose( $file_handle ); *** Testing DateTime::modify() : usage variation - unexpected values to first argument $modify*** -- int 0 -- -object(DateTime)#3 (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: DateTime::modify(): Failed to parse time string (0) at position 0 (0): Unexpected character in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 +bool(false) -- int 1 -- -object(DateTime)#3 (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: DateTime::modify(): Failed to parse time string (1) at position 0 (1): Unexpected character in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 +bool(false) -- int 12345 -- -object(DateTime)#3 (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: DateTime::modify(): Failed to parse time string (12345) at position 4 (5): Unexpected character in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 +bool(false) -- int -12345 -- -object(DateTime)#3 (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: DateTime::modify(): Failed to parse time string (-12345) at position 5 (5): Unexpected character in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 +bool(false) -- float 10.5 -- object(DateTime)#3 (3) { @@ -161,14 +141,9 @@ object(DateTime)#3 (3) { } -- float -10.5 -- -object(DateTime)#3 (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: DateTime::modify(): Failed to parse time string (-10.5) at position 4 (5): Unexpected character in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 +bool(false) -- float .5 -- object(DateTime)#3 (3) { @@ -182,181 +157,106 @@ object(DateTime)#3 (3) { -- empty array -- -Warning: DateTime::modify() expects parameter 1 to be string, array given in %s on line %d +Warning: DateTime::modify() expects parameter 1 to be string, array given in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 bool(false) -- int indexed array -- -Warning: DateTime::modify() expects parameter 1 to be string, array given in %s on line %d +Warning: DateTime::modify() expects parameter 1 to be string, array given in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 bool(false) -- associative array -- -Warning: DateTime::modify() expects parameter 1 to be string, array given in %s on line %d +Warning: DateTime::modify() expects parameter 1 to be string, array given in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 bool(false) -- nested arrays -- -Warning: DateTime::modify() expects parameter 1 to be string, array given in %s on line %d +Warning: DateTime::modify() expects parameter 1 to be string, array given in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 bool(false) -- uppercase NULL -- -object(DateTime)#3 (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: DateTime::modify(): Failed to parse time string () at position 0 ( in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 +bool(false) -- lowercase null -- -object(DateTime)#3 (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: DateTime::modify(): Failed to parse time string () at position 0 ( in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 +bool(false) -- lowercase true -- -object(DateTime)#3 (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: DateTime::modify(): Failed to parse time string (1) at position 0 (1): Unexpected character in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 +bool(false) -- lowercase false -- -object(DateTime)#3 (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: DateTime::modify(): Failed to parse time string () at position 0 ( in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 +bool(false) -- uppercase TRUE -- -object(DateTime)#3 (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: DateTime::modify(): Failed to parse time string (1) at position 0 (1): Unexpected character in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 +bool(false) -- uppercase FALSE -- -object(DateTime)#3 (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: DateTime::modify(): Failed to parse time string () at position 0 ( in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 +bool(false) -- empty string DQ -- -object(DateTime)#3 (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: DateTime::modify(): Failed to parse time string () at position 0 ( in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 +bool(false) -- empty string SQ -- -object(DateTime)#3 (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: DateTime::modify(): Failed to parse time string () at position 0 ( in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 +bool(false) -- string DQ -- -object(DateTime)#3 (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: DateTime::modify(): Failed to parse time string (string) at position 0 (s): The timezone could not be found in the database in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 +bool(false) -- string SQ -- -object(DateTime)#3 (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: DateTime::modify(): Failed to parse time string (string) at position 0 (s): The timezone could not be found in the database in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 +bool(false) -- mixed case string -- -object(DateTime)#3 (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: DateTime::modify(): Failed to parse time string (sTrInG) at position 0 (s): The timezone could not be found in the database in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 +bool(false) -- heredoc -- -object(DateTime)#3 (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: DateTime::modify(): Failed to parse time string (hello world) at position 0 (h): The timezone could not be found in the database in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 +bool(false) -- instance of classWithToString -- -object(DateTime)#3 (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: DateTime::modify(): Failed to parse time string (Class A object) at position 0 (C): The timezone could not be found in the database in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 +bool(false) -- instance of classWithoutToString -- -Warning: DateTime::modify() expects parameter 1 to be string, object given in %s on line %d +Warning: DateTime::modify() expects parameter 1 to be string, object given in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 bool(false) -- undefined var -- -object(DateTime)#3 (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: DateTime::modify(): Failed to parse time string () at position 0 ( in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 +bool(false) -- unset var -- -object(DateTime)#3 (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: DateTime::modify(): Failed to parse time string () at position 0 ( in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 +bool(false) -- resource -- -Warning: DateTime::modify() expects parameter 1 to be string, resource given in %s on line %d +Warning: DateTime::modify() expects parameter 1 to be string, resource given in /home/derick/dev/php/php-src/trunk/ext/date/tests/DateTime_modify_variation1.php on line 99 bool(false) ===DONE=== diff --git a/ext/date/tests/date_modify_variation2.phpt b/ext/date/tests/date_modify_variation2.phpt index 9689265f63..8dc563e25c 100644 --- a/ext/date/tests/date_modify_variation2.phpt +++ b/ext/date/tests/date_modify_variation2.phpt @@ -111,44 +111,24 @@ fclose( $file_handle ); *** Testing date_modify() : usage variation - unexpected values to second argument $format*** -- int 0 -- -object(DateTime)#%d (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: date_modify(): Failed to parse time string (0) at position 0 (0): Unexpected character in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 +bool(false) -- int 1 -- -object(DateTime)#%d (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: date_modify(): Failed to parse time string (1) at position 0 (1): Unexpected character in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 +bool(false) -- int 12345 -- -object(DateTime)#%d (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: date_modify(): Failed to parse time string (12345) at position 4 (5): Unexpected character in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 +bool(false) -- int -12345 -- -object(DateTime)#%d (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: date_modify(): Failed to parse time string (-12345) at position 5 (5): Unexpected character in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 +bool(false) -- float 10.5 -- object(DateTime)#%d (3) { @@ -161,14 +141,9 @@ object(DateTime)#%d (3) { } -- float -10.5 -- -object(DateTime)#%d (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: date_modify(): Failed to parse time string (-10.5) at position 4 (5): Unexpected character in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 +bool(false) -- float .5 -- object(DateTime)#%d (3) { @@ -182,181 +157,106 @@ object(DateTime)#%d (3) { -- empty array -- -Warning: date_modify() expects parameter 2 to be string, array given in %s on line %d +Warning: date_modify() expects parameter 2 to be string, array given in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 bool(false) -- int indexed array -- -Warning: date_modify() expects parameter 2 to be string, array given in %s on line %d +Warning: date_modify() expects parameter 2 to be string, array given in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 bool(false) -- associative array -- -Warning: date_modify() expects parameter 2 to be string, array given in %s on line %d +Warning: date_modify() expects parameter 2 to be string, array given in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 bool(false) -- nested arrays -- -Warning: date_modify() expects parameter 2 to be string, array given in %s on line %d +Warning: date_modify() expects parameter 2 to be string, array given in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 bool(false) -- uppercase NULL -- -object(DateTime)#%d (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: date_modify(): Failed to parse time string () at position 0 ( in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 +bool(false) -- lowercase null -- -object(DateTime)#%d (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: date_modify(): Failed to parse time string () at position 0 ( in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 +bool(false) -- lowercase true -- -object(DateTime)#%d (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: date_modify(): Failed to parse time string (1) at position 0 (1): Unexpected character in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 +bool(false) -- lowercase false -- -object(DateTime)#%d (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: date_modify(): Failed to parse time string () at position 0 ( in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 +bool(false) -- uppercase TRUE -- -object(DateTime)#%d (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: date_modify(): Failed to parse time string (1) at position 0 (1): Unexpected character in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 +bool(false) -- uppercase FALSE -- -object(DateTime)#%d (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: date_modify(): Failed to parse time string () at position 0 ( in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 +bool(false) -- empty string DQ -- -object(DateTime)#%d (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: date_modify(): Failed to parse time string () at position 0 ( in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 +bool(false) -- empty string SQ -- -object(DateTime)#%d (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: date_modify(): Failed to parse time string () at position 0 ( in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 +bool(false) -- string DQ -- -object(DateTime)#%d (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: date_modify(): Failed to parse time string (string) at position 0 (s): The timezone could not be found in the database in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 +bool(false) -- string SQ -- -object(DateTime)#%d (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: date_modify(): Failed to parse time string (string) at position 0 (s): The timezone could not be found in the database in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 +bool(false) -- mixed case string -- -object(DateTime)#%d (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: date_modify(): Failed to parse time string (sTrInG) at position 0 (s): The timezone could not be found in the database in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 +bool(false) -- heredoc -- -object(DateTime)#%d (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: date_modify(): Failed to parse time string (hello world) at position 0 (h): The timezone could not be found in the database in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 +bool(false) -- instance of classWithToString -- -object(DateTime)#%d (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: date_modify(): Failed to parse time string (Class A object) at position 0 (C): The timezone could not be found in the database in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 +bool(false) -- instance of classWithoutToString -- -Warning: date_modify() expects parameter 2 to be string, object given in %s on line %d +Warning: date_modify() expects parameter 2 to be string, object given in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 bool(false) -- undefined var -- -object(DateTime)#%d (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: date_modify(): Failed to parse time string () at position 0 ( in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 +bool(false) -- unset var -- -object(DateTime)#%d (3) { - ["date"]=> - string(19) "2009-01-31 14:28:41" - ["timezone_type"]=> - int(3) - ["timezone"]=> - string(13) "Europe/London" -} + +Warning: date_modify(): Failed to parse time string () at position 0 ( in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 +bool(false) -- resource -- -Warning: date_modify() expects parameter 2 to be string, resource given in %s on line %d +Warning: date_modify() expects parameter 2 to be string, resource given in /home/derick/dev/php/php-src/trunk/ext/date/tests/date_modify_variation2.php on line 99 bool(false) ===DONE=== -- 2.40.0