1--TEST--
2Test finfo_open() function : error functionality
3--SKIPIF--
4<?php require_once(dirname(__FILE__) . '/skipif.inc');
5--FILE--
6<?php
7/* Prototype  : resource finfo_open([int options [, string arg]])
8 * Description: Create a new fileinfo resource.
9 * Source code: ext/fileinfo/fileinfo.c
10 * Alias to functions:
11 */
12
13$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
14
15echo "*** Testing finfo_open() : error functionality ***\n";
16
17var_dump( finfo_open( FILEINFO_MIME, 'foobarfile' ) );
18var_dump( finfo_open( array(), $magicFile ) );
19var_dump( finfo_open( FILEINFO_MIME, $magicFile, 'extraArg' ) );
20var_dump( finfo_open( PHP_INT_MAX - 1, $magicFile ) );
21var_dump( finfo_open( 'foobar' ) );
22
23var_dump( new finfo('foobar') );
24
25?>
26===DONE===
27--EXPECTF--
28*** Testing finfo_open() : error functionality ***
29bool(false)
30
31Warning: finfo_open() expects parameter 1 to be long, array given in %s on line %d
32bool(false)
33
34Warning: finfo_open() expects at most 2 parameters, 3 given in %s on line %d
35bool(false)
36
37Notice: finfo_open(): Warning: using regular magic file `%s' in %s on line %d
38resource(%d) of type (file_info)
39
40Warning: finfo_open() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d
41bool(false)
42
43Warning: finfo::finfo() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d
44NULL
45===DONE===
46