readfile_variation6.phpt 907 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. --TEST--
  2. Test readfile() function : variation - test include path
  3. --CREDITS--
  4. Dave Kelsey <d_kelsey@uk.ibm.com>
  5. --FILE--
  6. <?php
  7. require_once('fopen_include_path.inc');
  8. echo "*** Testing readfile() : variation ***\n";
  9. // this doesn't create the include dirs in this directory
  10. // we change to this to ensure we are not part of the
  11. // include paths.
  12. $thisTestDir = "readfileVar6.dir";
  13. mkdir($thisTestDir);
  14. chdir($thisTestDir);
  15. $filename = "afile.txt";
  16. $secondFile = $dir2."/".$filename;
  17. $newpath = create_include_path();
  18. set_include_path($newpath);
  19. runtest();
  20. teardown_include_path();
  21. chdir("..");
  22. rmdir($thisTestDir);
  23. function runtest() {
  24. global $secondFile, $filename;
  25. $h = fopen($secondFile, "w");
  26. fwrite($h, "File in include path");
  27. fclose($h);
  28. readfile($filename, true);
  29. echo "\n";
  30. unlink($secondFile);
  31. }
  32. ?>
  33. --EXPECT--
  34. *** Testing readfile() : variation ***
  35. File in include path