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

1.1       misho       1: --TEST--
                      2: Test closedir() function : basic functionality 
                      3: --FILE--
                      4: <?php
                      5: /* Prototype  : void closedir([resource $dir_handle])
                      6:  * Description: Close directory connection identified by the dir_handle 
                      7:  * Source code: ext/standard/dir.c
                      8:  * Alias to functions: close
                      9:  */
                     10: 
                     11: /*
                     12:  * Test basic functionality of closedir()
                     13:  */
                     14: 
                     15: echo "*** Testing closedir() : basic functionality ***\n";
                     16: 
                     17: $base_dir = dirname(__FILE__);
                     18: $dir_path = $base_dir . '/closedir_basic';
                     19: mkdir($dir_path);
                     20: 
                     21: echo "\n-- Call closedir() with no arguments: --\n";
                     22: $dh1 = opendir($dir_path);
                     23: var_dump(closedir());
                     24: echo "-- Check Directory Handle: --\n";
                     25: var_dump($dh1);
                     26: 
                     27: echo "\n-- Call closedir() with \$dir_handle argument supplied: --\n";
                     28: $dh2 = opendir($dir_path);
                     29: 
                     30: if ((int)$dh1 === (int)$dh2) {
                     31:        echo "\nNo new resource created\n";
                     32: }
                     33: var_dump(closedir($dh2));
                     34: echo "-- Check Directory Handle: --\n";
                     35: var_dump($dh2);
                     36: ?>
                     37: ===DONE===
                     38: --CLEAN--
                     39: <?php
                     40: $base_dir = dirname(__FILE__);
                     41: $dir_path = $base_dir . '/closedir_basic';
                     42: rmdir($dir_path);
                     43: ?>
                     44: --EXPECTF--
                     45: *** Testing closedir() : basic functionality ***
                     46: 
                     47: -- Call closedir() with no arguments: --
                     48: NULL
                     49: -- Check Directory Handle: --
                     50: resource(%d) of type (Unknown)
                     51: 
                     52: -- Call closedir() with $dir_handle argument supplied: --
                     53: NULL
                     54: -- Check Directory Handle: --
                     55: resource(%d) of type (Unknown)
                     56: ===DONE===

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