1--TEST--
2Test finfo_open() function : basic 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() : basic functionality ***\n";
16
17// Calling finfo_open() with different options
18var_dump( finfo_open( FILEINFO_MIME, $magicFile ) );
19var_dump( finfo_open( FILEINFO_NONE, $magicFile ) );
20var_dump( finfo_open( FILEINFO_SYMLINK, $magicFile ) );
21//var_dump( finfo_open( FILEINFO_COMPRESS, $magicFile ) );
22var_dump( finfo_open( FILEINFO_DEVICES, $magicFile ) );
23var_dump( finfo_open( FILEINFO_CONTINUE, $magicFile ) );
24var_dump( finfo_open( FILEINFO_PRESERVE_ATIME, $magicFile ) );
25var_dump( finfo_open( FILEINFO_RAW, $magicFile ) );
26
27// OO inteface to finfo
28var_dump( new finfo( FILEINFO_MIME, $magicFile ) );
29var_dump( new finfo() );
30
31?>
32===DONE===
33--EXPECTF--
34*** Testing finfo_open() : basic functionality ***
35resource(%d) of type (file_info)
36resource(%d) of type (file_info)
37resource(%d) of type (file_info)
38resource(%d) of type (file_info)
39resource(%d) of type (file_info)
40resource(%d) of type (file_info)
41resource(%d) of type (file_info)
42object(finfo)#%d (%d) {
43}
44object(finfo)#%d (%d) {
45}
46===DONE===
47