]> granicus.if.org Git - php/commitdiff
Test for #51994
authorKai Schroeder <k.schroeder@php.net>
Sat, 17 Jul 2010 22:17:48 +0000 (22:17 +0000)
committerKai Schroeder <k.schroeder@php.net>
Sat, 17 Jul 2010 22:17:48 +0000 (22:17 +0000)
ext/date/tests/bug51994.phpt [new file with mode: 0644]

diff --git a/ext/date/tests/bug51994.phpt b/ext/date/tests/bug51994.phpt
new file mode 100644 (file)
index 0000000..e136c8f
--- /dev/null
@@ -0,0 +1,38 @@
+--TEST--
+Bug #51994 (date_parse_from_format is parsing invalid date using 'yz' format)
+--FILE--
+<?php
+$trans_date = '10153'; // 152nd day of year 2010 -> 03.06.2010
+$a_date        = date_parse_from_format('yz', $trans_date);
+
+var_dump($a_date);
+?>
+--EXPECTF--
+array(12) {
+  ["year"]=>
+  int(2010)
+  ["month"]=>
+  int(6)
+  ["day"]=>
+  int(3)
+  ["hour"]=>
+  bool(false)
+  ["minute"]=>
+  bool(false)
+  ["second"]=>
+  bool(false)
+  ["fraction"]=>
+  bool(false)
+  ["warning_count"]=>
+  int(0)
+  ["warnings"]=>
+  array(0) {
+  }
+  ["error_count"]=>
+  int(0)
+  ["errors"]=>
+  array(0) {
+  }
+  ["is_localtime"]=>
+  bool(false)
+}
\ No newline at end of file