ant Thu Nov 27 14:50:28 2008 UTC Added files: (Branch: PHP_5_3) /php-src/ext/standard/tests/directory directory_constants-win32.phpt DirectoryClass_basic_001.phpt DirectoryClass_error_001.phpt directory_constants.phpt Log: Directory tests: checked on PHP 5.2.6, 5.3 and 6.0 (Windows, Linux and Linux 64 bit).
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/directory/directory_constants-win32.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/directory/directory_constants-win32.phpt +++ php-src/ext/standard/tests/directory/directory_constants-win32.phpt --TEST-- Test that the Directory extension constants are correctly defined. --SKIPIF-- <?php if (substr(PHP_OS, 0, 3) != 'WIN') { die('skip.. only for Windows'); } ?> --FILE-- <?php echo DIRECTORY_SEPARATOR; echo "\n"; echo PATH_SEPARATOR; echo "\n"; echo "done"; ?> --EXPECT-- \ ; done http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/directory/DirectoryClass_basic_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/directory/DirectoryClass_basic_001.phpt +++ php-src/ext/standard/tests/directory/DirectoryClass_basic_001.phpt --TEST-- Directory class behaviour. --FILE-- <?php /* * Prototype: object dir(string directory[, resource context]) * Description: Directory class with properties, handle and class and methods read, rewind and close * Class is defined in ext/standard/dir.c */ echo "Structure of Directory class:\n"; $rc = new ReflectionClass("Directory"); echo $rc; echo "Cannot instantiate a valid Directory directly:\n"; $d = new Directory(getcwd()); var_dump($d); var_dump($d->read()); ?> --EXPECTF-- Structure of Directory class: Class [ <internal%s> class Directory ] { - Constants [0] { } - Static properties [0] { } - Static methods [0] { } - Properties [0] { } - Methods [3] { Method [ <internal%s> public method close ] { } Method [ <internal%s> public method rewind ] { } Method [ <internal%s> 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) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/directory/DirectoryClass_error_001.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/directory/DirectoryClass_error_001.phpt +++ php-src/ext/standard/tests/directory/DirectoryClass_error_001.phpt --TEST-- Directory class behaviour. --FILE-- <?php echo "\n--> 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 %d bool(false) Warning: Directory::rewind(): supplied argument is not a valid Directory resource in %s on line %d bool(false) Warning: Directory::close(): supplied argument is not a valid Directory resource in %s on line %d bool(false) --> Try all methods with no handle: Warning: Directory::read(): Unable to find my handle property in %s on line %d bool(false) Warning: Directory::rewind(): Unable to find my handle property in %s on line %d bool(false) Warning: Directory::close(): Unable to find my handle property in %s on line %d bool(false) --> Try all methods with wrong number of args: Warning: Directory::read() expects at most 1 parameter, 2 given in %s on line %d NULL Warning: Directory::rewind() expects at most 1 parameter, 2 given in %s on line %d NULL Warning: Directory::close() expects at most 1 parameter, 2 given in %s on line %d NULL http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/directory/directory_constants.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/directory/directory_constants.phpt +++ php-src/ext/standard/tests/directory/directory_constants.phpt --TEST-- Test that the Directory extension constants are correctly defined. --SKIPIF-- <?php if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip.. Not valid for Windows'); } ?> --FILE-- <?php echo DIRECTORY_SEPARATOR; echo "\n"; echo PATH_SEPARATOR; echo "\n"; echo "done"; ?> --EXPECT-- / : done -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php