From c1412ea367ea110bd2a4556a1eaed8a771795151 Mon Sep 17 00:00:00 2001 From: andy wharmby Date: Thu, 18 Jun 2009 21:14:16 +0000 Subject: [PATCH] Basic tests for strftime(). Tested on Windows (all tests skip), Linux and Liinux 64 bit --- ext/standard/tests/time/strptime_basic.phpt | 99 +++++++++++++++++++++ ext/standard/tests/time/strptime_error.phpt | 55 ++++++++++++ 2 files changed, 154 insertions(+) create mode 100644 ext/standard/tests/time/strptime_basic.phpt create mode 100644 ext/standard/tests/time/strptime_error.phpt diff --git a/ext/standard/tests/time/strptime_basic.phpt b/ext/standard/tests/time/strptime_basic.phpt new file mode 100644 index 0000000000..a3fa435d8c --- /dev/null +++ b/ext/standard/tests/time/strptime_basic.phpt @@ -0,0 +1,99 @@ +--TEST-- +Test strptime() function : basic functionality +--SKIPIF-- + + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing strptime() : basic functionality *** +array(9) { + ["tm_sec"]=> + int(0) + ["tm_min"]=> + int(0) + ["tm_hour"]=> + int(10) + ["tm_mday"]=> + int(2) + ["tm_mon"]=> + int(6) + ["tm_year"]=> + int(63) + ["tm_wday"]=> + int(2) + ["tm_yday"]=> + int(182) + ["unparsed"]=> + string(3) "GMT" +} +array(9) { + ["tm_sec"]=> + int(0) + ["tm_min"]=> + int(0) + ["tm_hour"]=> + int(10) + ["tm_mday"]=> + int(2) + ["tm_mon"]=> + int(6) + ["tm_year"]=> + int(163) + ["tm_wday"]=> + int(1) + ["tm_yday"]=> + int(182) + ["unparsed"]=> + string(0) "" +} +array(9) { + ["tm_sec"]=> + int(0) + ["tm_min"]=> + int(0) + ["tm_hour"]=> + int(10) + ["tm_mday"]=> + int(2) + ["tm_mon"]=> + int(6) + ["tm_year"]=> + int(0) + ["tm_wday"]=> + int(2) + ["tm_yday"]=> + int(182) + ["unparsed"]=> + string(0) "" +} +===DONE=== diff --git a/ext/standard/tests/time/strptime_error.phpt b/ext/standard/tests/time/strptime_error.phpt new file mode 100644 index 0000000000..92c7ca3474 --- /dev/null +++ b/ext/standard/tests/time/strptime_error.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test localtime() function : error conditions +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing strptime() : error conditions *** + +-- Testing strptime() function with Zero arguments -- + +Warning: strptime() expects exactly 2 parameters, 0 given in %s on line %d +NULL + +-- Testing strptime() function with less than expected no. of arguments -- + +Warning: strptime() expects exactly 2 parameters, 1 given in %s on line %d +NULL + +-- Testing strptime() function with more than expected no. of arguments -- + +Warning: strptime() expects exactly 2 parameters, 3 given in %s on line %d +NULL +===DONE=== + -- 2.40.0