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

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

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