Annotation of embedaddon/php/ext/standard/tests/class_object/get_class_vars_error.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test get_class_vars() function : error conditions
                      3: --FILE--
                      4: <?php
                      5: /* Prototype  : array get_class_vars(string class_name)
                      6:  * Description: Returns an array of default properties of the class.
                      7:  * Source code: Zend/zend_builtin_functions.c
                      8:  * Alias to functions:
                      9:  */
                     10: 
                     11: echo "*** Testing get_class_vars() : error conditions ***\n";
                     12: 
                     13: 
                     14: //Test get_class_vars with one more than the expected number of arguments
                     15: echo "\n-- Testing get_class_vars() function with more than expected no. of arguments --\n";
                     16: $obj = new stdclass();
                     17: $extra_arg = 10;
                     18: var_dump(get_class_vars($obj,$extra_arg) );
                     19: 
                     20: // Testing get_class_vars with one less than the expected number of arguments
                     21: echo "\n-- Testing get_class_vars() function with less than expected no. of arguments --\n";
                     22: var_dump(get_class_vars());
                     23: 
                     24: ?>
                     25: ===DONE===
                     26: --EXPECTF--
                     27: *** Testing get_class_vars() : error conditions ***
                     28: 
                     29: -- Testing get_class_vars() function with more than expected no. of arguments --
                     30: 
                     31: Warning: get_class_vars() expects exactly 1 parameter, 2 given in %sget_class_vars_error.php on line %d
                     32: NULL
                     33: 
                     34: -- Testing get_class_vars() function with less than expected no. of arguments --
                     35: 
                     36: Warning: get_class_vars() expects exactly 1 parameter, 0 given in %sget_class_vars_error.php on line %d
                     37: NULL
                     38: ===DONE===

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