diff options
Diffstat (limited to 'ext/date/tests/strtotime2.phpt')
| -rw-r--r-- | ext/date/tests/strtotime2.phpt | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/ext/date/tests/strtotime2.phpt b/ext/date/tests/strtotime2.phpt new file mode 100644 index 0000000..b8b6059 --- /dev/null +++ b/ext/date/tests/strtotime2.phpt @@ -0,0 +1,40 @@ +--TEST-- +strtotime() on date constants +--FILE-- +<?php + +date_default_timezone_set("Europe/Oslo"); +$time = time(); + +$constants = array( + 'DATE_ATOM', + 'DATE_COOKIE', + 'DATE_ISO8601', + 'DATE_RFC822', + 'DATE_RFC850', + 'DATE_RFC1036', + 'DATE_RFC1123', + 'DATE_RFC2822', + 'DATE_RFC3339', + 'DATE_RSS', + 'DATE_W3C' +); + + +foreach ($constants as $const) { + echo "$const:\t"; + echo ((strtotime(date(constant($const), $time)) === $time) ? "OK" : "FAIL") . "\n"; +} +?> +--EXPECT-- +DATE_ATOM: OK +DATE_COOKIE: OK +DATE_ISO8601: OK +DATE_RFC822: OK +DATE_RFC850: OK +DATE_RFC1036: OK +DATE_RFC1123: OK +DATE_RFC2822: OK +DATE_RFC3339: OK +DATE_RSS: OK +DATE_W3C: OK |
