import zend standard tests
[hiphop-php.git] / hphp / test / zend / bad / ext-standard-dir / dir_variation6.php
blob567f8da1c15c32faa91ad0be7f0e30c93cfe7892
1 <?php
2 /*
3 * Prototype : object dir(string $directory[, resource $context])
4 * Description: Directory class with properties, handle and class and methods read, rewind and close
5 * Source code: ext/standard/dir.c
6 */
8 /*
9 * Passing a non-existent directory as argument to dir() function
10 * and checking to see if proper warning message is output.
12 echo "*** Testing dir() : open a non-existent directory ***\n";
14 // create the temporary directory
15 $file_path = dirname(__FILE__);
16 $dir_path = $file_path."/dir_variation6";
17 @mkdir($dir_path);
19 // open existent directory
20 $d = dir($dir_path);
21 $d->close(); //close the dir
23 // remove directory and try to open the same(non-existent) directory again
24 rmdir($dir_path);
25 clearstatcache();
27 echo "-- opening previously removed directory --\n";
28 var_dump( dir($dir_path) );
30 // point to a non-existent directory
31 $non_existent_dir = $file_path."/non_existent_dir";
32 echo "-- opening non-existent directory --\n";
33 $d = dir($non_existent_dir);
34 var_dump( $d );
36 echo "Done";