Annotation of embedaddon/php/ext/standard/tests/general_functions/php_uname_error.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test php_uname() function - error conditions - pass function incorrect arguments
! 3: --FILE--
! 4: <?php
! 5: /* Prototype: string php_uname ([ string $mode ] )
! 6: * Description: Returns information about the operating system PHP is running on
! 7: */
! 8:
! 9: echo "*** Testing php_uname() - error test\n";
! 10:
! 11: echo "\n-- Testing php_uname() function with more than expected no. of arguments --\n";
! 12: var_dump( php_uname('a', true) );
! 13:
! 14: echo "\n-- Testing php_uname() function with invalid mode --\n";
! 15: // am invalid mode shoudl result in same o/p as mode 'a'
! 16: var_dump( php_uname('z') == php_uname('z') );
! 17:
! 18: class barClass {
! 19: }
! 20:
! 21: $fp = fopen(__FILE__, "r");
! 22:
! 23: echo "\n-- Testing php_uname() function with invalid argument types --\n";
! 24: var_dump(php_uname(array()));
! 25: var_dump(php_uname(array('color' => 'red', 'item' => 'pen')));
! 26: var_dump(php_uname(new barClass()));
! 27: var_dump(php_uname($fp));
! 28:
! 29: fclose($fp);
! 30: ?>
! 31: ===DONE===
! 32: --EXPECTF--
! 33: *** Testing php_uname() - error test
! 34:
! 35: -- Testing php_uname() function with more than expected no. of arguments --
! 36:
! 37: Warning: php_uname() expects at most 1 parameter, 2 given in %s on line %d
! 38: NULL
! 39:
! 40: -- Testing php_uname() function with invalid mode --
! 41: bool(true)
! 42:
! 43: -- Testing php_uname() function with invalid argument types --
! 44:
! 45: Warning: php_uname() expects parameter 1 to be string, array given in %s on line %d
! 46: NULL
! 47:
! 48: Warning: php_uname() expects parameter 1 to be string, array given in %s on line %d
! 49: NULL
! 50:
! 51: Warning: php_uname() expects parameter 1 to be string, object given in %s on line %d
! 52: NULL
! 53:
! 54: Warning: php_uname() expects parameter 1 to be string, resource given in %s on line %d
! 55: NULL
! 56: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>