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

1.1       misho       1: --TEST--
                      2: Test dir() function : usage variations - checking with wildcard characters
                      3: --FILE--
                      4: <?php
                      5: /* 
                      6:  * Prototype  : object dir(string $directory[, resource $context])
                      7:  * Description: Directory class with properties, handle and class and methods read, rewind and close
                      8:  * Source code: ext/standard/dir.c
                      9:  */
                     10: 
                     11: /* 
                     12:  * Create more than one temporary directory & subdirectory and check if dir() function can open 
                     13:  * those directories when wildcard characters are used to refer to them.
                     14:  */
                     15: 
                     16: echo "*** Testing dir() : checking with wildcard characters ***\n";
                     17: 
                     18: // create the temporary directories
                     19: $file_path = dirname(__FILE__);
                     20: $dir_path = $file_path."/dir_variation81";
                     21: $sub_dir_path = $dir_path."/sub_dir1";
                     22: 
                     23: @mkdir($dir_path1);
                     24: @mkdir($sub_dir_path);
                     25: 
                     26: /* with different wildcard characters */
                     27: 
                     28: echo "-- wildcard = '*' --\n"; 
                     29: var_dump( dir($file_path."/dir_var*") );
                     30: var_dump( dir($file_path."/*") );
                     31: 
                     32: echo "-- wildcard = '?' --\n";
                     33: var_dump( dir($dir_path."/sub_dir?") );
                     34: var_dump( dir($dir_path."/sub?dir1") );
                     35: 
                     36: echo "Done";
                     37: ?>
                     38: --EXPECTF--
                     39: *** Testing dir() : checking with wildcard characters ***
                     40: -- wildcard = '*' --
                     41: 
                     42: Warning: dir(%s/dir_var*): failed to open dir: %s in %s on line %d
                     43: bool(false)
                     44: 
                     45: Warning: dir(%s/*): failed to open dir: %s in %s on line %d
                     46: bool(false)
                     47: -- wildcard = '?' --
                     48: 
                     49: Warning: dir(%s/dir_variation81/sub_dir?): failed to open dir: %s in %s on line %d
                     50: bool(false)
                     51: 
                     52: Warning: dir(%s/dir_variation81/sub?dir1): failed to open dir: %s in %s on line %d
                     53: bool(false)
                     54: Done

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