Return to opendir_variation6-win32.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 3: --SKIPIF-- 4: <?php 5: if (substr(PHP_OS, 0, 3) != 'WIN') { 6: die("skip Valid only on Windows"); 7: } 8: ?> 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*,%s/opendir_var*): %s in %s on line %d 55: 56: Warning: opendir(%s/opendir_var*): failed to open dir: %s in %s on line %d 57: bool(false) 58: 59: Warning: opendir(%s/*,%s/*): %s in %s on line %d 60: 61: Warning: opendir(%s/*): failed to open dir: %s in %s on line %d 62: bool(false) 63: 64: -- Wildcard = '?' -- 65: 66: Warning: opendir(%s/opendir_variation6/sub_dir?,%s/opendir_variation6/sub_dir?): %s in %s on line %d 67: 68: Warning: opendir(%s/opendir_variation6/sub_dir?): failed to open dir: %s in %s on line %d 69: bool(false) 70: 71: Warning: opendir(%s/opendir_variation6/sub?dir1,%s/opendir_variation6/sub?dir1): %s in %s on line %d 72: 73: Warning: opendir(%s/opendir_variation6/sub?dir1): failed to open dir: %s in %s on line %d 74: bool(false) 75: ===DONE===