Return to rewinddir_error.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / dir |
1.1 misho 1: --TEST-- 2: Test rewinddir() function : error conditions - incorrect number of args 3: --FILE-- 4: <?php 5: /* Prototype : void rewinddir([resource $dir_handle]) 6: * Description: Rewind dir_handle back to the start 7: * Source code: ext/standard/dir.c 8: * Alias to functions: rewind 9: */ 10: 11: /* 12: * Pass incorrect number of arguments to rewinddir() to test behaviour 13: */ 14: 15: echo "*** Testing rewinddir() : error conditions ***\n"; 16: 17: 18: //Test rewinddir with one more than the expected number of arguments 19: echo "\n-- Testing rewinddir() function with more than expected no. of arguments --\n"; 20: 21: $dir_path = dirname(__FILE__) . "/rewinddir_error"; 22: mkdir($dir_path); 23: $dir_handle = opendir($dir_path); 24: $extra_arg = 10; 25: 26: var_dump( rewinddir($dir_handle, $extra_arg) ); 27: closedir($dir_handle); 28: ?> 29: ===DONE=== 30: --CLEAN-- 31: <?php 32: $dir_path = dirname(__FILE__) . "/rewinddir_error"; 33: rmdir($dir_path); 34: ?> 35: --EXPECTF-- 36: *** Testing rewinddir() : error conditions *** 37: 38: -- Testing rewinddir() function with more than expected no. of arguments -- 39: 40: Warning: rewinddir() expects at most 1 parameter, 2 given in %s on line %d 41: NULL 42: ===DONE===