]> granicus.if.org Git - php/commitdiff
add moneyformat test
authorStanislav Malyshev <stas@php.net>
Wed, 6 Jun 2007 17:13:18 +0000 (17:13 +0000)
committerStanislav Malyshev <stas@php.net>
Wed, 6 Jun 2007 17:13:18 +0000 (17:13 +0000)
ext/standard/tests/strings/moneyformat.phpt [new file with mode: 0755]

diff --git a/ext/standard/tests/strings/moneyformat.phpt b/ext/standard/tests/strings/moneyformat.phpt
new file mode 100755 (executable)
index 0000000..6481302
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST--
+money_format test
+--SKIPIF--
+<?php
+       if (!function_exists('money_format') || !function_exists('setlocale')) {
+               die("SKIP money_format - not supported\n");
+       }
+?>
+--FILE--
+<?php
+setlocale(LC_MONETARY, 'en_US');
+var_dump( money_format("X%nY", 3.1415));
+var_dump(money_format("AAAAA%n%n%n%n", NULL));
+?>
+--EXPECTF--
+string(7) "X$3.14Y"
+
+Warning: money_format(): Only a single %%i or %%n token can be used in %s on line %d
+bool(false)