Annotation of embedaddon/php/ext/standard/tests/file/readfile_variation6.phpt, revision 1.1.1.1

1.1       misho       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: /* Prototype  : int readfile(string filename [, bool use_include_path[, resource context]])
                      8:  * Description: Output a file or a URL 
                      9:  * Source code: ext/standard/file.c
                     10:  * Alias to functions: 
                     11:  */
                     12: 
                     13: require_once('fopen_include_path.inc');
                     14: 
                     15: echo "*** Testing readfile() : variation ***\n";
                     16: // this doesn't create the include dirs in this directory
                     17: // we change to this to ensure we are not part of the
                     18: // include paths.
                     19: $thisTestDir = "readfileVar6.dir";
                     20: mkdir($thisTestDir);
                     21: chdir($thisTestDir);
                     22: 
                     23: $filename = "afile.txt";
                     24: $secondFile = $dir2."/".$filename;
                     25: 
                     26: $newpath = create_include_path();
                     27: set_include_path($newpath);
                     28: runtest();
                     29: teardown_include_path();
                     30: restore_include_path();
                     31: chdir("..");
                     32: rmdir($thisTestDir);
                     33: 
                     34: 
                     35: function runtest() {
                     36:    global $secondFile, $filename;
                     37:    $h = fopen($secondFile, "w");
                     38:    fwrite($h, "File in include path");
                     39:    fclose($h);
                     40:    readfile($filename, true);
                     41:    echo "\n";
                     42:    unlink($secondFile);  
                     43: }
                     44: 
                     45: ?>
                     46: ===DONE===
                     47: --EXPECT--
                     48: *** Testing readfile() : variation ***
                     49: File in include path
                     50: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>