From a2dd5c26cd882a7d31fc81aa991539a94ffcc1ef Mon Sep 17 00:00:00 2001 From: andy wharmby Date: Thu, 18 Jun 2009 21:14:14 +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 | 102 ++++++++++++++++++++ ext/standard/tests/time/strptime_error.phpt | 55 +++++++++++ 2 files changed, 157 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..8f11003739 --- /dev/null +++ b/ext/standard/tests/time/strptime_basic.phpt @@ -0,0 +1,102 @@ +--TEST-- +Test strptime() function : basic functionality +--SKIPIF-- + + +--FILE-- + +===DONE=== +--EXPECTF-- +Deprecated: setlocale(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d +*** Testing strptime() : basic functionality *** +array(9) { + [u"tm_sec"]=> + int(0) + [u"tm_min"]=> + int(0) + [u"tm_hour"]=> + int(10) + [u"tm_mday"]=> + int(2) + [u"tm_mon"]=> + int(6) + [u"tm_year"]=> + int(63) + [u"tm_wday"]=> + int(2) + [u"tm_yday"]=> + int(182) + [u"unparsed"]=> + unicode(3) "GMT" +} +array(9) { + [u"tm_sec"]=> + int(0) + [u"tm_min"]=> + int(0) + [u"tm_hour"]=> + int(10) + [u"tm_mday"]=> + int(2) + [u"tm_mon"]=> + int(6) + [u"tm_year"]=> + int(163) + [u"tm_wday"]=> + int(1) + [u"tm_yday"]=> + int(182) + [u"unparsed"]=> + unicode(0) "" +} +array(9) { + [u"tm_sec"]=> + int(0) + [u"tm_min"]=> + int(0) + [u"tm_hour"]=> + int(10) + [u"tm_mday"]=> + int(2) + [u"tm_mon"]=> + int(6) + [u"tm_year"]=> + int(0) + [u"tm_wday"]=> + int(2) + [u"tm_yday"]=> + int(182) + [u"unparsed"]=> + unicode(0) "" +} + +Deprecated: setlocale(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d +===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.50.1