Return to tempnam_error.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / file |
1.1 misho 1: --TEST-- 2: Test tempnam() function: error conditions 3: --FILE-- 4: <?php 5: /* Prototype: string tempnam ( string $dir, string $prefix ); 6: Description: Create file with unique file name. 7: */ 8: 9: echo "*** Testing tempnam() error conditions ***\n"; 10: $file_path = dirname(__FILE__); 11: 12: /* More number of arguments than expected */ 13: var_dump( tempnam("$file_path", "tempnam_error.tmp", "") ); //Two Valid & One Invalid 14: var_dump( tempnam("$file_path", "tempnam_error.tmp", TRUE) ); 15: 16: /* Less number of arguments than expected */ 17: var_dump( tempnam("tempnam_error") ); //One Valid arg 18: var_dump( tempnam("$file_path") ); //One Valid arg 19: var_dump( tempnam("") ); //Empty string 20: var_dump( tempnam(NULL) ); //NULL as arg 21: var_dump( tempnam() ); //Zero args 22: 23: echo "*** Done ***\n"; 24: ?> 25: --EXPECTF-- 26: *** Testing tempnam() error conditions *** 27: 28: Warning: tempnam() expects exactly 2 parameters, 3 given in %s on line %d 29: NULL 30: 31: Warning: tempnam() expects exactly 2 parameters, 3 given in %s on line %d 32: NULL 33: 34: Warning: tempnam() expects exactly 2 parameters, 1 given in %s on line %d 35: NULL 36: 37: Warning: tempnam() expects exactly 2 parameters, 1 given in %s on line %d 38: NULL 39: 40: Warning: tempnam() expects exactly 2 parameters, 1 given in %s on line %d 41: NULL 42: 43: Warning: tempnam() expects exactly 2 parameters, 1 given in %s on line %d 44: NULL 45: 46: Warning: tempnam() expects exactly 2 parameters, 0 given in %s on line %d 47: NULL 48: *** Done ***