1--TEST--
2Test fileowner() function: basic functionality
3--FILE--
4<?php
5echo "*** Testing fileowner(): basic functionality ***\n";
6
7echo "-- Testing with the file or directory created by owner --\n";
8var_dump( fileowner(__FILE__) );
9var_dump( fileowner(".") );
10var_dump( fileowner("./..") );
11
12/* Newly created files and dirs */
13$file_path = __DIR__;
14$file_name = $file_path."/fileowner_basic.tmp";
15$file_handle = fopen($file_name, "w");
16$string = "Hello, world\n1234\n123Hello";
17fwrite($file_handle, $string);
18var_dump( fileowner($file_name) );
19fclose($file_handle);
20
21$dir_name = $file_path."/fileowner_basic";
22mkdir($dir_name);
23var_dump( fileowner($dir_name) );
24
25echo "*** Done ***\n";
26?>
27--CLEAN--
28<?php
29$file_path = __DIR__;
30$file_name = $file_path."/fileowner_basic.tmp";
31$dir_name = $file_path."/fileowner_basic";
32unlink($file_name);
33rmdir($dir_name);
34?>
35--EXPECTF--
36*** Testing fileowner(): basic functionality ***
37-- Testing with the file or directory created by owner --
38int(%d)
39int(%d)
40int(%d)
41int(%d)
42int(%d)
43*** Done ***
44