1--TEST--
2Test file_put_contents() function : variation - include path testing
3--CREDITS--
4Dave Kelsey <d_kelsey@uk.ibm.com>
5--FILE--
6<?php
7require_once('fopen_include_path.inc');
8
9$thisTestDir = basename(__FILE__, ".php") . ".dir";
10mkdir($thisTestDir);
11chdir($thisTestDir);
12
13$filename = basename(__FILE__, ".php") . ".tmp";
14
15$newpath = create_include_path();
16set_include_path($newpath);
17runtest();
18
19$newpath = generate_next_path();
20set_include_path($newpath);
21runtest();
22
23teardown_include_path();
24chdir("..");
25rmdir($thisTestDir);
26
27
28function runtest() {
29   global $filename;
30   //correct php53 behaviour is to ignore the FILE_USE_INCLUDE_PATH unless the file already exists
31   // in the include path. In this case it doesn't so the file should be written in the current dir.
32   file_put_contents($filename, "File in include path", FILE_USE_INCLUDE_PATH);
33   $line = file_get_contents($filename);
34   echo "$line\n";
35   unlink($filename);
36}
37
38?>
39--EXPECT--
40File in include path
41File in include path
42