Annotation of embedaddon/php/ext/standard/tests/dir/closedir_variation2.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test closedir() function : usage variations - close directory handle twice
! 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: * close the directory handle twice using closedir() to test behaviour
! 13: */
! 14:
! 15: echo "*** Testing closedir() : usage variations ***\n";
! 16:
! 17: //create temporary directory for test, removed in CLEAN section
! 18: $directory = dirname(__FILE__) . "/closedir_variation2";
! 19: mkdir($directory);
! 20:
! 21: $dh = opendir($directory);
! 22:
! 23: echo "\n-- Close directory handle first time: --\n";
! 24: var_dump(closedir($dh));
! 25: echo "Directory Handle: ";
! 26: var_dump($dh);
! 27:
! 28: echo "\n-- Close directory handle second time: --\n";
! 29: var_dump(closedir($dh));
! 30: echo "Directory Handle: ";
! 31: var_dump($dh);
! 32: ?>
! 33: ===DONE===
! 34: --CLEAN--
! 35: <?php
! 36: $directory = dirname(__FILE__) . "/closedir_variation2";
! 37: rmdir($directory);
! 38: ?>
! 39: --EXPECTF--
! 40: *** Testing closedir() : usage variations ***
! 41:
! 42: -- Close directory handle first time: --
! 43: NULL
! 44: Directory Handle: resource(%d) of type (Unknown)
! 45:
! 46: -- Close directory handle second time: --
! 47:
! 48: Warning: closedir(): %d is not a valid Directory resource in %s on line %d
! 49: bool(false)
! 50: Directory Handle: resource(%d) of type (Unknown)
! 51: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>