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";
33
34var_dump( money_format($string, $value, $extra_arg) );
35
36?>
37===DONE===
38--EXPECTF--
39*** Testing money_format() : error conditions ***
40
41-- Testing money_format() function with no arguments --
42
43Warning: money_format() expects exactly 2 parameters, 0 given in %s on line %d
44NULL
45
46-- Testing money_format() function with insufficient arguments --
47
48Warning: money_format() expects exactly 2 parameters, 1 given in %s on line %d
49NULL
50
51-- Testing money_format() function with more than expected no. of arguments --
52
53Warning: money_format() expects exactly 2 parameters, 3 given in %s on line %d
54NULL
55===DONE===