diff options
author | Gustavo André dos Santos Lopes <cataphract@php.net> | 2012-05-07 01:18:30 +0200 |
---|---|---|
committer | Gustavo André dos Santos Lopes <cataphract@php.net> | 2012-05-13 20:53:06 +0100 |
commit | 0295ed7d225dcd9f5cbd21cfb335912a87af894d (patch) | |
tree | 02772dd38b67c9ae3a099cb8e4f9c962c960ab33 /ext/intl/tests/msgfmt_format_datetime.phpt | |
parent | 1c4f99b98828bb752794e0fc45bd3884848b001d (diff) | |
download | php-git-0295ed7d225dcd9f5cbd21cfb335912a87af894d.tar.gz |
Added new MessageFormatter tests.
Diffstat (limited to 'ext/intl/tests/msgfmt_format_datetime.phpt')
-rw-r--r-- | ext/intl/tests/msgfmt_format_datetime.phpt | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/ext/intl/tests/msgfmt_format_datetime.phpt b/ext/intl/tests/msgfmt_format_datetime.phpt new file mode 100644 index 0000000000..a79b822b6d --- /dev/null +++ b/ext/intl/tests/msgfmt_format_datetime.phpt @@ -0,0 +1,26 @@ +--TEST-- +MessageFormatter::format(): DateTime accepted to format dates and times +--SKIPIF-- +<?php +if (!extension_loaded('intl')) + die('skip intl extension not enabled'); +--FILE-- +<?php +ini_set("intl.error_level", E_WARNING); +//ini_set("intl.default_locale", "nl"); + +$fmt = <<<EOD +{0,date} {0,time} +EOD; + +$dt = new DateTime("2012-05-06 18:00:42", new DateTimeZone("Europe/Lisbon")); + +$mf = new MessageFormatter('en_US', $fmt); + +var_dump($mf->format(array($dt))); + +?> +==DONE== +--EXPECTF-- +string(%s) "May %d, 2012 %d:%d:42 %s" +==DONE==
\ No newline at end of file |