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  NULL,
23
24  /* scalars */
25  1234,
26  0
27);
28
29/* loop through to test each element the above array */
30foreach( $filenames as $filename ) {
31  var_dump( fileowner($filename) );
32  clearstatcache();
33}
34?>
35--CLEAN--
36<?php
37$file_path = __DIR__;
38unlink($file_path."/fileowner_variation2.tmp");
39?>
40--EXPECTF--
41*** Testing Invalid file types ***
42
43Warning: fileowner(): stat failed for -2.34555 in %s on line %d
44bool(false)
45
46Warning: fileowner(): stat failed for   in %s on line %d
47bool(false)
48bool(false)
49
50Warning: fileowner(): stat failed for 1 in %s on line %d
51bool(false)
52bool(false)
53bool(false)
54
55Warning: fileowner(): stat failed for 1234 in %s on line %d
56bool(false)
57
58Warning: fileowner(): stat failed for 0 in %s on line %d
59bool(false)
60