From d475703660e16255509d667e9c5f87fee50f1aaf Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Sat, 13 Nov 2010 16:30:22 +0000 Subject: [PATCH] - Copied test cases (that all fail?!) from 5.3 to trunk. --- ext/date/tests/bug48187.phpt | 26 ++++++++++++++++++++++++ ext/date/tests/bug50475.phpt | 18 +++++++++++++++++ ext/date/tests/bug51819.phpt | 31 +++++++++++++++++++++++++++++ ext/date/tests/bug51994.phpt | 38 ++++++++++++++++++++++++++++++++++++ 4 files changed, 113 insertions(+) create mode 100644 ext/date/tests/bug48187.phpt create mode 100644 ext/date/tests/bug50475.phpt create mode 100644 ext/date/tests/bug51819.phpt create mode 100644 ext/date/tests/bug51994.phpt diff --git a/ext/date/tests/bug48187.phpt b/ext/date/tests/bug48187.phpt new file mode 100644 index 0000000000..24a295ddd6 --- /dev/null +++ b/ext/date/tests/bug48187.phpt @@ -0,0 +1,26 @@ +--TEST-- +Bug #48187 (DateTime::diff() corrupting microtime() result) +--FILE-- + +--EXPECTF-- +string(36) "microtime() difference less 1 second" +string(31) "time() difference less 1 second" \ No newline at end of file diff --git a/ext/date/tests/bug50475.phpt b/ext/date/tests/bug50475.phpt new file mode 100644 index 0000000000..454e86c6b5 --- /dev/null +++ b/ext/date/tests/bug50475.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #50475 (DateTime::setISODate followed by DateTime::setTime) +--FILE-- +setISODate(2009, 6, 1); + +var_dump($date->format('Y-m-d H:i:s')); + +$date->setTime(8, 0); +var_dump($date->format('Y-m-d H:i:s')); +?> +--EXPECT-- +string(19) "2009-02-02 00:00:00" +string(19) "2009-02-02 08:00:00" \ No newline at end of file diff --git a/ext/date/tests/bug51819.phpt b/ext/date/tests/bug51819.phpt new file mode 100644 index 0000000000..afcb9c7d48 --- /dev/null +++ b/ext/date/tests/bug51819.phpt @@ -0,0 +1,31 @@ +--TEST-- +Bug #51819 (Case discrepancy in timezone names cause Uncaught exception and fatal error) +--FILE-- +getMessage()); + } +} + +var_dump('this should be the only output'); +?> +--EXPECTF-- +string(30) "this should be the only output" \ No newline at end of file diff --git a/ext/date/tests/bug51994.phpt b/ext/date/tests/bug51994.phpt new file mode 100644 index 0000000000..e136c8f2b6 --- /dev/null +++ b/ext/date/tests/bug51994.phpt @@ -0,0 +1,38 @@ +--TEST-- +Bug #51994 (date_parse_from_format is parsing invalid date using 'yz' format) +--FILE-- + 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 -- 2.40.0