Return to opendir_variation6.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / dir |
1.1 misho 1: --TEST-- 2: Test opendir() function : usage variations - Different wildcards 1.1.1.2 ! misho 3: --SKIPIF-- ! 4: <?php ! 5: if (substr(PHP_OS, 0, 3) == 'WIN') { ! 6: die('skip.. Not valid for Windows'); ! 7: } ! 8: ?> 1.1 misho 9: --FILE-- 10: <?php 11: /* Prototype : mixed opendir(string $path[, resource $context]) 12: * Description: Open a directory and return a dir_handle 13: * Source code: ext/standard/dir.c 14: */ 15: 16: /* 17: * Pass paths containing wildcards to test if opendir() recognises them 18: */ 19: 20: echo "*** Testing opendir() : usage variations ***\n"; 21: // create the temporary directories 22: $file_path = dirname(__FILE__); 23: $dir_path = $file_path . "/opendir_variation6"; 24: $sub_dir_path = $dir_path . "/sub_dir1"; 25: 26: mkdir($dir_path); 27: mkdir($sub_dir_path); 28: 29: // with different wildcard characters 30: 31: echo "\n-- Wildcard = '*' --\n"; 32: var_dump( opendir($file_path . "/opendir_var*") ); 33: var_dump( opendir($file_path . "/*") ); 34: 35: echo "\n-- Wildcard = '?' --\n"; 36: var_dump( opendir($dir_path . "/sub_dir?") ); 37: var_dump( opendir($dir_path . "/sub?dir1") ); 38: 39: ?> 40: ===DONE=== 41: --CLEAN-- 42: <?php 43: $dir_path = dirname(__FILE__) . "/opendir_variation6"; 44: $sub_dir_path = $dir_path . "/sub_dir1"; 45: 46: rmdir($sub_dir_path); 47: rmdir($dir_path); 48: ?> 49: --EXPECTF-- 50: *** Testing opendir() : usage variations *** 51: 52: -- Wildcard = '*' -- 53: 54: Warning: opendir(%s/opendir_var*): failed to open dir: %s in %s on line %d 55: bool(false) 56: 57: Warning: opendir(%s/*): failed to open dir: %s in %s on line %d 58: bool(false) 59: 60: -- Wildcard = '?' -- 61: 62: Warning: opendir(%s/opendir_variation6/sub_dir?): failed to open dir: %s in %s on line %d 63: bool(false) 64: 65: Warning: opendir(%s/opendir_variation6/sub?dir1): failed to open dir: %s in %s on line %d 66: bool(false) 67: ===DONE===