Annotation of embedaddon/php/ext/standard/tests/dir/rewinddir_variation2.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test rewinddir() function : usage variations - operate on a closed directory
3: --FILE--
4: <?php
5: /* Prototype : void rewinddir([resource $dir_handle])
6: * Description: Rewind dir_handle back to the start
7: * Source code: ext/standard/dir.c
8: * Alias to functions: rewind
9: */
10:
11: /*
12: * Open and close a directory handle then call rewinddir() to test behaviour
13: */
14:
15: echo "*** Testing rewinddir() : usage variations ***\n";
16:
17: $dir_path = dirname(__FILE__) . '/rewinddir_variation2';
18: mkdir($dir_path);
19:
20: echo "\n-- Create the directory handle, read and close the directory --\n";
21: var_dump($dir_handle = opendir($dir_path));
22: var_dump(readdir($dir_handle));
23: closedir($dir_handle);
24:
25: echo "\n-- Call to rewinddir() --\n";
26: var_dump(rewinddir($dir_handle));
27: ?>
28: ===DONE===
29: --CLEAN--
30: <?php
31: $dir_path = dirname(__FILE__) . '/rewinddir_variation2';
32: rmdir($dir_path);
33: ?>
34: --EXPECTF--
35: *** Testing rewinddir() : usage variations ***
36:
37: -- Create the directory handle, read and close the directory --
38: resource(%d) of type (stream)
39: string(%d) "%s"
40:
41: -- Call to rewinddir() --
42:
43: Warning: rewinddir(): %d is not a valid Directory resource in %s on line %d
44: bool(false)
45: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>