Annotation of embedaddon/php/ext/standard/tests/file/filesize_error.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test filesize() function: error conditions
3: --FILE--
4: <?php
5: /*
6: * Prototype : int filesize ( string $filename );
7: * Description : Returns the size of the file in bytes, or FALSE
8: * (and generates an error of level E_WARNING) in case of an error.
9: */
10:
11: echo "*** Testing filesize(): error conditions ***";
12:
13: /* Non-existing file or dir */
14: var_dump( filesize("/no/such/file") );
15: var_dump( filesize("/no/such/dir") );
16:
17: /* No.of arguments less than expected */
18: var_dump( filesize() );
19:
20: /* No.of arguments greater than expected */
21: var_dump( filesize(__FILE__, 2000) );
22: echo "\n";
23:
24: echo "*** Done ***\n";
25: ?>
26: --EXPECTF--
27: *** Testing filesize(): error conditions ***
28: Warning: filesize(): stat failed for /no/such/file in %s on line %d
29: bool(false)
30:
31: Warning: filesize(): stat failed for /no/such/dir in %s on line %d
32: bool(false)
33:
34: Warning: filesize() expects exactly 1 parameter, 0 given in %s on line %d
35: NULL
36:
37: Warning: filesize() expects exactly 1 parameter, 2 given in %s on line %d
38: NULL
39:
40: *** Done ***
41:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>