1--TEST--
2Test finfo_close() function : error conditions
3--SKIPIF--
4<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
5--FILE--
6<?php
7/* Prototype  : resource finfo_close(resource finfo)
8 * Description: Close fileinfo resource.
9 * Source code: ext/fileinfo/fileinfo.c
10 * Alias to functions:
11 */
12
13echo "*** Testing finfo_close() : error conditions ***\n";
14
15$magicFile = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'magic';
16$finfo = finfo_open( FILEINFO_MIME, $magicFile );
17$fp = fopen( __FILE__, 'r' );
18
19echo "\n-- Testing finfo_close() function with Zero arguments --\n";
20var_dump( finfo_close() );
21
22echo "\n-- Testing finfo_close() function with more than expected no. of arguments --\n";
23var_dump( finfo_close( $finfo, '10') );
24
25echo "\n-- Testing finfo_close() function with wrong resource type --\n";
26var_dump( finfo_close( $fp ) );
27
28?>
29===DONE===
30--EXPECTF--
31*** Testing finfo_close() : error conditions ***
32
33-- Testing finfo_close() function with Zero arguments --
34
35Warning: finfo_close() expects exactly 1 parameter, 0 given in %s on line %d
36bool(false)
37
38-- Testing finfo_close() function with more than expected no. of arguments --
39
40Warning: finfo_close() expects exactly 1 parameter, 2 given in %s on line %d
41bool(false)
42
43-- Testing finfo_close() function with wrong resource type --
44
45Warning: finfo_close(): supplied resource is not a valid file_info resource in %s on line %d
46bool(false)
47===DONE===
48