1--TEST--
2Test fopen() function : variation: use include path create a file (absolute)
3--CREDITS--
4Dave Kelsey <d_kelsey@uk.ibm.com>
5--FILE--
6<?php
7require_once('fopen_include_path.inc');
8
9echo "*** Testing fopen() : variation ***\n";
10$newpath = create_include_path();
11set_include_path($newpath);
12runtest();
13$newpath = generate_next_path();
14set_include_path($newpath);
15runtest();
16
17teardown_include_path();
18
19
20function runtest() {
21    $tempDir = 'fopen_variation13.dir.tmp';
22    $tmpfile = 'fopen_variation13.tmp';
23    $absFile = getcwd().'/'.$tempDir.'/'.$tmpfile;
24
25    mkdir($tempDir);
26    $h = fopen($absFile, "w", true);
27    fwrite($h, "This is the test file");
28    fclose($h);
29
30
31    $h = fopen($absFile, "r");
32    if ($h === false) {
33       echo "Not created absolute location\n";
34    }
35    else {
36       echo "Created in correct location\n";
37       fclose($h);
38    }
39    unlink($absFile);
40    rmdir($tempDir);
41
42}
43?>
44--EXPECT--
45*** Testing fopen() : variation ***
46Created in correct location
47Created in correct location
48