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