1--TEST--
2Directory class behaviour.
3--FILE--
4<?php
5
6$d = getcwd().PATH_SEPARATOR."私はガラスを食べられます";
7
8mkdir($d);
9
10echo "\n--> Try all methods with bad handle:\n";
11$d = new Directory($d);
12$d->handle = "Havoc!";
13var_dump($d->read());
14var_dump($d->rewind());
15var_dump($d->close());
16
17echo "\n--> Try all methods with no handle:\n";
18$d = new Directory($d);
19unset($d->handle);
20var_dump($d->read());
21var_dump($d->rewind());
22var_dump($d->close());
23
24echo "\n--> Try all methods with wrong number of args:\n";
25$d = new Directory($d);
26var_dump($d->read(1,2));
27var_dump($d->rewind(1,2));
28var_dump($d->close(1,2));
29
30?>
31--CLEAN--
32<?php
33$d = getcwd().PATH_SEPARATOR."私はガラスを食べられます";
34rmdir($d);
35
36?>
37--EXPECTF--
38--> Try all methods with bad handle:
39
40Warning: Directory::read(): supplied argument is not a valid Directory resource in %s on line %d
41bool(false)
42
43Warning: Directory::rewind(): supplied argument is not a valid Directory resource in %s on line %d
44bool(false)
45
46Warning: Directory::close(): supplied argument is not a valid Directory resource in %s on line %d
47bool(false)
48
49--> Try all methods with no handle:
50
51Warning: Directory::read(): Unable to find my handle property in %s on line %d
52bool(false)
53
54Warning: Directory::rewind(): Unable to find my handle property in %s on line %d
55bool(false)
56
57Warning: Directory::close(): Unable to find my handle property in %s on line %d
58bool(false)
59
60--> Try all methods with wrong number of args:
61
62Warning: Directory::read() expects at most 1 parameter, 2 given in %s on line %d
63NULL
64
65Warning: Directory::rewind() expects at most 1 parameter, 2 given in %s on line %d
66NULL
67
68Warning: Directory::close() expects at most 1 parameter, 2 given in %s on line %d
69NULL
70