1--TEST--
2Test fileowner() function: usage variations - invalid filenames
3--CREDITS--
4Dave Kelsey <d_kelsey@uk.ibm.com>
5--CONFLICTS--
6obscure_filename
7--FILE--
8<?php
9
10/* Testing fileowner() with invalid arguments -int, float, bool, NULL, resource */
11
12$file_path = __DIR__;
13
14echo "*** Testing Invalid file types ***\n";
15$filenames = array(
16  /* Invalid filenames */
17  -2.34555,
18  " ",
19  "",
20  TRUE,
21  FALSE,
22
23  /* scalars */
24  1234,
25  0
26);
27
28/* loop through to test each element the above array */
29foreach( $filenames as $filename ) {
30  var_dump( fileowner($filename) );
31  clearstatcache();
32}
33?>
34--EXPECTF--
35*** Testing Invalid file types ***
36
37Warning: fileowner(): stat failed for -2.34555 in %s on line %d
38bool(false)
39
40Warning: fileowner(): stat failed for   in %s on line %d
41bool(false)
42bool(false)
43
44Warning: fileowner(): stat failed for 1 in %s on line %d
45bool(false)
46bool(false)
47
48Warning: fileowner(): stat failed for 1234 in %s on line %d
49bool(false)
50
51Warning: fileowner(): stat failed for 0 in %s on line %d
52bool(false)
53