Annotation of embedaddon/php/ext/standard/tests/directory/DirectoryClass_error_001.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Directory class behaviour.
3: --FILE--
4: <?php
5:
6: echo "\n--> Try all methods with bad handle:\n";
7: $d = new Directory(getcwd());
8: $d->handle = "Havoc!";
9: var_dump($d->read());
10: var_dump($d->rewind());
11: var_dump($d->close());
12:
13: echo "\n--> Try all methods with no handle:\n";
14: $d = new Directory(getcwd());
15: unset($d->handle);
16: var_dump($d->read());
17: var_dump($d->rewind());
18: var_dump($d->close());
19:
20: echo "\n--> Try all methods with wrong number of args:\n";
21: $d = new Directory(getcwd());
22: var_dump($d->read(1,2));
23: var_dump($d->rewind(1,2));
24: var_dump($d->close(1,2));
25:
26: ?>
27: --EXPECTF--
28: --> Try all methods with bad handle:
29:
30: Warning: Directory::read(): supplied argument is not a valid Directory resource in %s on line %d
31: bool(false)
32:
33: Warning: Directory::rewind(): supplied argument is not a valid Directory resource in %s on line %d
34: bool(false)
35:
36: Warning: Directory::close(): supplied argument is not a valid Directory resource in %s on line %d
37: bool(false)
38:
39: --> Try all methods with no handle:
40:
41: Warning: Directory::read(): Unable to find my handle property in %s on line %d
42: bool(false)
43:
44: Warning: Directory::rewind(): Unable to find my handle property in %s on line %d
45: bool(false)
46:
47: Warning: Directory::close(): Unable to find my handle property in %s on line %d
48: bool(false)
49:
50: --> Try all methods with wrong number of args:
51:
52: Warning: Directory::read() expects at most 1 parameter, 2 given in %s on line %d
53: NULL
54:
55: Warning: Directory::rewind() expects at most 1 parameter, 2 given in %s on line %d
56: NULL
57:
58: Warning: Directory::close() expects at most 1 parameter, 2 given in %s on line %d
59: NULL
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>