Annotation of embedaddon/php/ext/standard/tests/strings/money_format_error.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test 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: 
                     24: echo "*** Testing money_format() : error conditions ***\n";
                     25: 
                     26: echo "\n-- Testing money_format() function with no arguments --\n";
                     27: var_dump( money_format() );
                     28: 
                     29: echo "\n-- Testing money_format() function with insufficient arguments --\n";
                     30: var_dump( money_format($string) );
                     31: 
                     32: echo "\n-- Testing money_format() function with more than expected no. of arguments --\n";
                     33: 
                     34: var_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: 
                     43: Warning: money_format() expects exactly 2 parameters, 0 given in %s on line %d
                     44: NULL
                     45: 
                     46: -- Testing money_format() function with insufficient arguments --
                     47: 
                     48: Warning: money_format() expects exactly 2 parameters, 1 given in %s on line %d
                     49: NULL
                     50: 
                     51: -- Testing money_format() function with more than expected no. of arguments --
                     52: 
                     53: Warning: money_format() expects exactly 2 parameters, 3 given in %s on line %d
                     54: NULL
                     55: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>