Annotation of embedaddon/php/ext/standard/tests/file/fpassthru_error.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test fpassthru() function: Error conditions
3: --FILE--
4: <?php
5: /*
6: Prototype: int fpassthru ( resource $handle );
7: Description: Reads to EOF on the given file pointer from the current position
8: and writes the results to the output buffer.
9: */
10:
11: echo "*** Test error conditions of fpassthru() function ***\n";
12:
13: /* Non-existing file resource */
14: $no_file = fread("/no/such/file", "r");
15: var_dump( fpassthru($no_file) );
16:
17: /* No.of args less than expected */
18: var_dump( fpassthru() );
19:
20: /* No.of args greaer than expected */
21: var_dump( fpassthru("", "") );
22:
23: echo "\n*** Done ***\n";
24:
25: ?>
26: --EXPECTF--
27: *** Test error conditions of fpassthru() function ***
28:
29: Warning: fread() expects parameter 1 to be resource, string given in %s on line %d
30:
31: Warning: fpassthru() expects parameter 1 to be resource, boolean given in %s on line %d
32: bool(false)
33:
34: Warning: fpassthru() expects exactly 1 parameter, 0 given in %s on line %d
35: bool(false)
36:
37: Warning: fpassthru() expects exactly 1 parameter, 2 given in %s on line %d
38: bool(false)
39:
40: *** Done ***
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>