From 7dec2a73540771eb548389b94b4d70ad19ffd54e Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Tue, 27 Jun 2006 15:55:06 +0000 Subject: [PATCH] more tests --- ext/date/tests/005.phpt | 45 ++++++++++++++++++ ext/date/tests/006.phpt | 33 +++++++++++++ ext/date/tests/007.phpt | 101 ++++++++++++++++++++++++++++++++++++++++ ext/date/tests/008.phpt | 67 ++++++++++++++++++++++++++ ext/date/tests/009.phpt | 42 +++++++++++++++++ 5 files changed, 288 insertions(+) create mode 100644 ext/date/tests/005.phpt create mode 100644 ext/date/tests/006.phpt create mode 100644 ext/date/tests/007.phpt create mode 100644 ext/date/tests/008.phpt create mode 100644 ext/date/tests/009.phpt diff --git a/ext/date/tests/005.phpt b/ext/date/tests/005.phpt new file mode 100644 index 0000000000..c6551b76b4 --- /dev/null +++ b/ext/date/tests/005.phpt @@ -0,0 +1,45 @@ +--TEST-- +idate() and invalid params +--INI-- +date.timezone=UTC +--FILE-- + +--EXPECTF-- +Warning: idate() expects at least 1 parameter, 0 given in %s on line %d +bool(false) + +Warning: idate() expects at most 2 parameters, 3 given in %s on line %d +bool(false) + +Warning: idate(): Unrecognized date format token. in %s on line %d +bool(false) + +Warning: idate(): idate format is one char in %s on line %d +bool(false) + +Warning: idate(): Unrecognized date format token. in %s on line %d +bool(false) +int(41) + +Warning: idate(): Unrecognized date format token. in %s on line %d +bool(false) + +Warning: idate(): Unrecognized date format token. in %s on line %d +bool(false) +Done diff --git a/ext/date/tests/006.phpt b/ext/date/tests/006.phpt new file mode 100644 index 0000000000..407242b161 --- /dev/null +++ b/ext/date/tests/006.phpt @@ -0,0 +1,33 @@ +--TEST-- +checkdate() tests +--INI-- +date.timezone=UTC +--FILE-- + +--EXPECTF-- +Warning: checkdate() expects exactly 3 parameters, 0 given in %s on line %d +bool(false) +bool(true) +bool(false) +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +bool(false) +Done diff --git a/ext/date/tests/007.phpt b/ext/date/tests/007.phpt new file mode 100644 index 0000000000..f0c8784659 --- /dev/null +++ b/ext/date/tests/007.phpt @@ -0,0 +1,101 @@ +--TEST-- +localtime() tests +--INI-- +date.timezone=UTC +--FILE-- + +--EXPECTF-- +Warning: localtime() expects at most 2 parameters, 3 given in %s on line %d +bool(false) +array(9) { + [0]=> + int(%d) + [1]=> + int(%d) + [2]=> + int(%d) + [3]=> + int(%d) + [4]=> + int(%d) + [5]=> + int(%d) + [6]=> + int(%d) + [7]=> + int(%d) + [8]=> + int(%d) +} +array(9) { + [0]=> + int(0) + [1]=> + int(0) + [2]=> + int(0) + [3]=> + int(27) + [4]=> + int(5) + [5]=> + int(106) + [6]=> + int(2) + [7]=> + int(177) + [8]=> + int(0) +} +array(9) { + ["tm_sec"]=> + int(0) + ["tm_min"]=> + int(0) + ["tm_hour"]=> + int(0) + ["tm_mday"]=> + int(27) + ["tm_mon"]=> + int(5) + ["tm_year"]=> + int(106) + ["tm_wday"]=> + int(2) + ["tm_yday"]=> + int(177) + ["tm_isdst"]=> + int(0) +} +array(9) { + [0]=> + int(0) + [1]=> + int(0) + [2]=> + int(0) + [3]=> + int(27) + [4]=> + int(5) + [5]=> + int(106) + [6]=> + int(2) + [7]=> + int(177) + [8]=> + int(0) +} +Done diff --git a/ext/date/tests/008.phpt b/ext/date/tests/008.phpt new file mode 100644 index 0000000000..424e156783 --- /dev/null +++ b/ext/date/tests/008.phpt @@ -0,0 +1,67 @@ +--TEST-- +getdate() tests +--INI-- +date.timezone=UTC +--FILE-- + +--EXPECTF-- +Warning: getdate() expects at most 1 parameter, 2 given in %s on line %d +bool(false) +array(11) { + ["seconds"]=> + int(0) + ["minutes"]=> + int(0) + ["hours"]=> + int(0) + ["mday"]=> + int(27) + ["wday"]=> + int(2) + ["mon"]=> + int(6) + ["year"]=> + int(2006) + ["yday"]=> + int(177) + ["weekday"]=> + string(7) "Tuesday" + ["month"]=> + string(4) "June" + [0]=> + int(1151366400) +} +array(11) { + ["seconds"]=> + int(%d) + ["minutes"]=> + int(%d) + ["hours"]=> + int(%d) + ["mday"]=> + int(%d) + ["wday"]=> + int(%d) + ["mon"]=> + int(%d) + ["year"]=> + int(%d) + ["yday"]=> + int(%d) + ["weekday"]=> + string(%d) "%s" + ["month"]=> + string(%d) "%s" + [0]=> + int(%d) +} +Done diff --git a/ext/date/tests/009.phpt b/ext/date/tests/009.phpt new file mode 100644 index 0000000000..7ecb103da3 --- /dev/null +++ b/ext/date/tests/009.phpt @@ -0,0 +1,42 @@ +--TEST-- +strftime() and gmstrftime() tests +--INI-- +date.timezone=Asia/Jerusalem +--FILE-- + +--EXPECTF-- +Warning: strftime() expects at least 1 parameter, 0 given in %s on line %d +bool(false) +bool(false) +string(179) "Tue Tuesday Jun June Tue Jun 27 00:00:00 2006 20 27 06/27/06 27 06 2006 Jun 00 12 178 06 00 + AM 12:00:00 AM 00:00 00 00:00:00 2 26 26 26 2 06/27/06 00:00:00 06 2006 IDT +0300 %" +string(2) "%q" +string(4) "blah" + +Warning: gmstrftime() expects at least 1 parameter, 0 given in %s on line %d +bool(false) +bool(false) +string(178) "Mon Monday Jun June Mon Jun 26 21:00:00 2006 20 26 06/26/06 26 06 2006 Jun 21 09 177 06 00 + PM 09:00:00 PM 21:00 00 21:00:00 1 26 26 26 1 06/26/06 21:00:00 06 2006 GMT +0000 %" +string(2) "%q" +string(4) "blah" +Done -- 2.40.0