Annotation of embedaddon/php/ext/standard/tests/dir/dir_variation8-win32.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test dir() function : usage variations - checking with wildcard characters
! 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: /*
! 12: * Prototype : object dir(string $directory[, resource $context])
! 13: * Description: Directory class with properties, handle and class and methods read, rewind and close
! 14: * Source code: ext/standard/dir.c
! 15: */
! 16:
! 17: /*
! 18: * Create more than one temporary directory & subdirectory and check if dir() function can open
! 19: * those directories when wildcard characters are used to refer to them.
! 20: */
! 21:
! 22: echo "*** Testing dir() : checking with wildcard characters ***\n";
! 23:
! 24: // create the temporary directories
! 25: $file_path = dirname(__FILE__);
! 26: $dir_path = $file_path."/dir_variation81";
! 27: $sub_dir_path = $dir_path."/sub_dir1";
! 28:
! 29: @mkdir($dir_path1);
! 30: @mkdir($sub_dir_path);
! 31:
! 32: /* with different wildcard characters */
! 33:
! 34: echo "-- wildcard = '*' --\n";
! 35: var_dump( dir($file_path."/dir_var*") );
! 36: var_dump( dir($file_path."/*") );
! 37:
! 38: echo "-- wildcard = '?' --\n";
! 39: var_dump( dir($dir_path."/sub_dir?") );
! 40: var_dump( dir($dir_path."/sub?dir1") );
! 41:
! 42: echo "Done";
! 43: ?>
! 44: --EXPECTF--
! 45: *** Testing dir() : checking with wildcard characters ***
! 46: -- wildcard = '*' --
! 47:
! 48: Warning: dir(%s/dir_var*,%s/dir_var*): No such file or directory in %s on line %d
! 49:
! 50: Warning: dir(%s/dir_var*): failed to open dir: %s in %s on line %d
! 51: bool(false)
! 52:
! 53: Warning: dir(%s/*,%s/*): No such file or directory in %s on line %d
! 54:
! 55: Warning: dir(%s/*): failed to open dir: %s in %s on line %d
! 56: bool(false)
! 57: -- wildcard = '?' --
! 58:
! 59: Warning: dir(%s/dir_variation81/sub_dir?,%s/dir_variation81/sub_dir?): No such file or directory in %s on line %d
! 60:
! 61: Warning: dir(%s/dir_variation81/sub_dir?): failed to open dir: %s in %s on line %d
! 62: bool(false)
! 63:
! 64: Warning: dir(%s/dir_variation81/sub?dir1,%s/dir_variation81/sub?dir1): No such file or directory in %s on line %d
! 65:
! 66: Warning: dir(%s/dir_variation81/sub?dir1): failed to open dir: %s in %s on line %d
! 67: bool(false)
! 68: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>