Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / php / ext / standard / tests / streams / stream_get_meta_data_file_error.phpt
blob390694a0627d290f11479d8aa0aa743c77a48624
1 --TEST--
2 Test stream_get_meta_data() function : error conditions 
3 --FILE--
4 <?php
5 /* Prototype  : proto array stream_get_meta_data(resource fp)
6  * Description: Retrieves header/meta data from streams/file pointers 
7  * Source code: ext/standard/streamsfuncs.c
8  * Alias to functions: socket_get_status
9  */
11 echo "*** Testing stream_get_meta_data() : error conditions ***\n";
13 // Zero arguments
14 echo "\n-- Testing stream_get_meta_data() function with Zero arguments --\n";
15 var_dump( stream_get_meta_data() );
17 //Test stream_get_meta_data with one more than the expected number of arguments
18 echo "\n-- Testing stream_get_meta_data() function with more than expected no. of arguments --\n";
20 $fp = null;
21 $extra_arg = 10;
22 var_dump( stream_get_meta_data($fp, $extra_arg) );
24 echo "\n-- Testing stream_get_meta_data() function with invalid stream resource --\n";
25 $fp = null;
26 var_dump(stream_get_meta_data($fp));
28 echo "\n-- Testing stream_get_meta_data() function with closed stream resource --\n";
29 $fp = fopen(__FILE__, 'r');
30 fclose($fp);
31 var_dump(stream_get_meta_data($fp));
33 echo "Done";
35 --EXPECTF--
36 *** Testing stream_get_meta_data() : error conditions ***
38 -- Testing stream_get_meta_data() function with Zero arguments --
40 Warning: stream_get_meta_data() expects exactly 1 parameter, 0 given in %s on line %i
41 NULL
43 -- Testing stream_get_meta_data() function with more than expected no. of arguments --
45 Warning: stream_get_meta_data() expects exactly 1 parameter, 2 given in %s on line %i
46 NULL
48 -- Testing stream_get_meta_data() function with invalid stream resource --
50 Warning: stream_get_meta_data() expects parameter 1 to be resource, null given in %s on line %i
51 NULL
53 -- Testing stream_get_meta_data() function with closed stream resource --
55 Warning: stream_get_meta_data(): %i is not a valid stream resource in %s on line %i
56 bool(false)
57 Done