diff --git a/ext/standard/tests/directory/DirectoryClass_basic_001.phpt b/ext/standard/tests/directory/DirectoryClass_basic_001.phpt new file mode 100644 index 00000000000..e8ffd5752ae --- /dev/null +++ b/ext/standard/tests/directory/DirectoryClass_basic_001.phpt @@ -0,0 +1,53 @@ +--TEST-- +Directory class behaviour. +--FILE-- +read()); + +?> +--EXPECTF-- +Structure of Directory class: +Class [ class Directory ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [3] { + Method [ public method close ] { + } + + Method [ public method rewind ] { + } + + Method [ public method read ] { + } + } +} +Cannot instantiate a valid Directory directly: +object(Directory)#%d (0) { +} + +Warning: Directory::read(): Unable to find my handle property in %s on line 15 +bool(false) \ No newline at end of file diff --git a/ext/standard/tests/directory/DirectoryClass_error_001.phpt b/ext/standard/tests/directory/DirectoryClass_error_001.phpt new file mode 100644 index 00000000000..b435d9e661f --- /dev/null +++ b/ext/standard/tests/directory/DirectoryClass_error_001.phpt @@ -0,0 +1,60 @@ +--TEST-- +Directory class behaviour. +--FILE-- + Try all methods with bad handle:\n"; +$d = new Directory(getcwd()); +$d->handle = "Havoc!"; +var_dump($d->read()); +var_dump($d->rewind()); +var_dump($d->close()); + +echo "\n--> Try all methods with no handle:\n"; +$d = new Directory(getcwd()); +unset($d->handle); +var_dump($d->read()); +var_dump($d->rewind()); +var_dump($d->close()); + +echo "\n--> Try all methods with wrong number of args:\n"; +$d = new Directory(getcwd()); +var_dump($d->read(1,2)); +var_dump($d->rewind(1,2)); +var_dump($d->close(1,2)); + +?> +--EXPECTF-- + +--> Try all methods with bad handle: + +Warning: Directory::read(): supplied argument is not a valid Directory resource in %s on line 6 +bool(false) + +Warning: Directory::rewind(): supplied argument is not a valid Directory resource in %s on line 7 +bool(false) + +Warning: Directory::close(): supplied argument is not a valid Directory resource in %s on line 8 +bool(false) + +--> Try all methods with no handle: + +Warning: Directory::read(): Unable to find my handle property in %s on line 13 +bool(false) + +Warning: Directory::rewind(): Unable to find my handle property in %s on line 14 +bool(false) + +Warning: Directory::close(): Unable to find my handle property in %s on line 15 +bool(false) + +--> Try all methods with wrong number of args: + +Warning: Wrong parameter count for Directory::read() in %s on line 19 +NULL + +Warning: Wrong parameter count for Directory::rewind() in %s on line 20 +NULL + +Warning: Wrong parameter count for Directory::close() in %s on line 21 +NULL \ No newline at end of file diff --git a/ext/standard/tests/directory/directory_constants-win32.phpt b/ext/standard/tests/directory/directory_constants-win32.phpt new file mode 100644 index 00000000000..6a9a066d647 --- /dev/null +++ b/ext/standard/tests/directory/directory_constants-win32.phpt @@ -0,0 +1,26 @@ +--TEST-- +Test that the Directory extension constants are correctly defined. +--SKIPIF-- + +--FILE-- + +--EXPECT-- +\ +; +done diff --git a/ext/standard/tests/directory/directory_constants.phpt b/ext/standard/tests/directory/directory_constants.phpt new file mode 100644 index 00000000000..f8e143bc137 --- /dev/null +++ b/ext/standard/tests/directory/directory_constants.phpt @@ -0,0 +1,26 @@ +--TEST-- +Test that the Directory extension constants are correctly defined. +--SKIPIF-- + +--FILE-- + +--EXPECT-- +/ +: +done