import zend standard tests
[hiphop-php.git] / hphp / test / zend / bad / ext-standard-file / mkdir_rmdir_variation2.php
blob50288ef7f83dbbf6aa1c78180853a59e531b87d9
1 <?php
2 /* Prototype: bool mkdir ( string $pathname [, int $mode [, bool $recursive [, resource $context]]] );
3 Description: Makes directory
4 */
6 $context = stream_context_create();
8 $file_path = dirname(__FILE__);
10 echo "\n*** Testing mkdir() and rmdir() by giving stream context as fourth argument ***\n";
11 var_dump( mkdir("$file_path/mkdir_variation2/test/", 0777, true, $context) );
12 var_dump( rmdir("$file_path/mkdir_variation2/test/", $context) );
14 echo "\n*** Testing rmdir() on a non-empty directory ***\n";
15 var_dump( mkdir("$file_path/mkdir_variation2/test/", 0777, true) );
16 var_dump( rmdir("$file_path/mkdir_variation2/") );
18 echo "\n*** Testing mkdir() and rmdir() for binary safe functionality ***\n";
19 var_dump( mkdir("$file_path/temp".chr(0)."/") );
20 var_dump( rmdir("$file_path/temp".chr(0)."/") );
22 echo "\n*** Testing mkdir() with miscelleneous input ***\n";
23 /* changing mode of mkdir to prevent creating sub-directory under it */
24 var_dump( chmod("$file_path/mkdir_variation2/", 0000) );
25 /* creating sub-directory test1 under mkdir, expected: false */
26 var_dump( mkdir("$file_path/mkdir_variation2/test1", 0777, true) );
27 var_dump( chmod("$file_path/mkdir_variation2/", 0777) ); // chmod to enable removing test1 directory
29 echo "Done\n";
30 ?><?php
31 rmdir(dirname(__FILE__)."/mkdir_variation2/test/");
32 rmdir(dirname(__FILE__)."/mkdir_variation2/");