1--TEST--
2Test money_format() function : error conditions
3--SKIPIF--
4<?php
5	if (!function_exists('money_format')) {
6		die("SKIP money_format - not supported\n");
7	}
8?>
9--FILE--
10<?php
11/* Prototype  : string money_format  ( string $format  , float $number  )
12 * Description: Formats a number as a currency string
13 * Source code: ext/standard/string.c
14*/
15
16// ===========================================================================================
17// = We do not test for exact return-values, as those might be different between OS-versions =
18// ===========================================================================================
19
20$string = '%14#8.2n';
21$value = 1234.56;
22$extra_arg = 10;
23
24echo "*** Testing money_format() : error conditions ***\n";
25
26echo "\n-- Testing money_format() function with no arguments --\n";
27var_dump( money_format() );
28
29echo "\n-- Testing money_format() function with insufficient arguments --\n";
30var_dump( money_format($string) );
31
32echo "\n-- Testing money_format() function with more than expected no. of arguments --\n";
33var_dump( money_format($string, $value, $extra_arg) );
34
35echo "\n-- Testing money_format() function with more than one token --\n";
36var_dump( money_format($string . $string, $value) );
37?>
38===DONE===
39--EXPECTF--
40*** Testing money_format() : error conditions ***
41
42-- Testing money_format() function with no arguments --
43
44Warning: money_format() expects exactly 2 parameters, 0 given in %s on line %d
45NULL
46
47-- Testing money_format() function with insufficient arguments --
48
49Warning: money_format() expects exactly 2 parameters, 1 given in %s on line %d
50NULL
51
52-- Testing money_format() function with more than expected no. of arguments --
53
54Warning: money_format() expects exactly 2 parameters, 3 given in %s on line %d
55NULL
56
57-- Testing money_format() function with more than one token --
58
59Warning: money_format(): Only a single %ci or %cn token can be used in %s on line %d
60bool(false)
61===DONE===
62