Annotation of embedaddon/php/ext/standard/tests/dir/dir_variation8.phpt, revision 1.1.1.2

1.1       misho       1: --TEST--
                      2: Test dir() function : usage variations - checking with wildcard characters
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: /* 
                     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*): failed to open dir: %s in %s on line %d
                     49: bool(false)
                     50: 
                     51: Warning: dir(%s/*): failed to open dir: %s in %s on line %d
                     52: bool(false)
                     53: -- wildcard = '?' --
                     54: 
                     55: Warning: dir(%s/dir_variation81/sub_dir?): failed to open dir: %s in %s on line %d
                     56: bool(false)
                     57: 
                     58: Warning: dir(%s/dir_variation81/sub?dir1): failed to open dir: %s in %s on line %d
                     59: bool(false)
                     60: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>