1--TEST--
2Test finfo_file() function : basic functionality
3--SKIPIF--
4<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
5--FILE--
6<?php
7/* Prototype  : string finfo_file(resource finfo, char *file_name [, int options [, resource context]])
8 * Description: Return information about a file.
9 * Source code: ext/fileinfo/fileinfo.c
10 * Alias to functions:
11 */
12
13$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
14$finfo = finfo_open( FILEINFO_MIME );
15
16echo "*** Testing finfo_file() : basic functionality ***\n";
17
18// Calling finfo_file() with all possible arguments
19var_dump( finfo_file( $finfo, __FILE__) );
20var_dump( finfo_file( $finfo, __FILE__, FILEINFO_CONTINUE ) );
21var_dump( finfo_file( $finfo, $magicFile ) );
22var_dump( finfo_file( $finfo, $magicFile.chr(0).$magicFile) );
23
24?>
25===DONE===
26--EXPECTF--
27*** Testing finfo_file() : basic functionality ***
28string(28) "text/x-php; charset=us-ascii"
29string(22) "PHP script, ASCII text"
30string(25) "text/plain; charset=utf-8"
31
32Warning: finfo_file(): Invalid path in %s/finfo_file_basic.php on line %d
33bool(false)
34===DONE===
35