summaryrefslogtreecommitdiff
path: root/ext/date/tests/bug50392.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/date/tests/bug50392.phpt')
-rw-r--r--ext/date/tests/bug50392.phpt84
1 files changed, 33 insertions, 51 deletions
diff --git a/ext/date/tests/bug50392.phpt b/ext/date/tests/bug50392.phpt
index 8d10923e03..4fa506ef55 100644
--- a/ext/date/tests/bug50392.phpt
+++ b/ext/date/tests/bug50392.phpt
@@ -7,57 +7,39 @@ date_default_timezone_set('Europe/Bratislava');
$base = '2009-03-01 18:00:00';
for ($i = 0; $i < 8; $i++) {
- var_dump(date_create_from_format('Y-m-d H:i:s.u', $base . '.' . str_repeat('1', $i)));
+ $string = $base . '.' . str_repeat($i, $i);
+ echo $string, "\n- ";
+ $result = date_parse_from_format('Y-m-d H:i:s.u', $string);
+ echo $result['fraction'] ? $result['fraction'] : 'X', "\n";
+ foreach( $result['errors'] as $error ) {
+ echo "- ", $error, "\n";
+ }
+ echo "\n";
}
?>
--EXPECT--
-bool(false)
-object(DateTime)#2 (3) {
- ["date"]=>
- string(19) "2009-03-01 18:00:00"
- ["timezone_type"]=>
- int(3)
- ["timezone"]=>
- string(17) "Europe/Bratislava"
-}
-object(DateTime)#2 (3) {
- ["date"]=>
- string(19) "2009-03-01 18:00:00"
- ["timezone_type"]=>
- int(3)
- ["timezone"]=>
- string(17) "Europe/Bratislava"
-}
-object(DateTime)#2 (3) {
- ["date"]=>
- string(19) "2009-03-01 18:00:00"
- ["timezone_type"]=>
- int(3)
- ["timezone"]=>
- string(17) "Europe/Bratislava"
-}
-object(DateTime)#2 (3) {
- ["date"]=>
- string(19) "2009-03-01 18:00:00"
- ["timezone_type"]=>
- int(3)
- ["timezone"]=>
- string(17) "Europe/Bratislava"
-}
-object(DateTime)#2 (3) {
- ["date"]=>
- string(19) "2009-03-01 18:00:00"
- ["timezone_type"]=>
- int(3)
- ["timezone"]=>
- string(17) "Europe/Bratislava"
-}
-object(DateTime)#2 (3) {
- ["date"]=>
- string(19) "2009-03-01 18:00:00"
- ["timezone_type"]=>
- int(3)
- ["timezone"]=>
- string(17) "Europe/Bratislava"
-}
-bool(false)
+2009-03-01 18:00:00.
+- X
+- Data missing
+
+2009-03-01 18:00:00.1
+- 0.1
+
+2009-03-01 18:00:00.22
+- 0.22
+
+2009-03-01 18:00:00.333
+- 0.333
+
+2009-03-01 18:00:00.4444
+- 0.4444
+
+2009-03-01 18:00:00.55555
+- 0.55555
+
+2009-03-01 18:00:00.666666
+- 0.666666
+
+2009-03-01 18:00:00.7777777
+- 0.777777
+- Trailing data