1--TEST--
2Test finfo_file() function : regex rules
3--EXTENSIONS--
4fileinfo
5--FILE--
6<?php
7/**
8 * Works with the unix file command:
9 * $ file -m magic resources/test.awk
10 * resources/test.awk: awk script, ASCII text
11 */
12$magicFile = __DIR__ . DIRECTORY_SEPARATOR . 'magic';
13$finfo = finfo_open( FILEINFO_MIME, $magicFile );
14
15echo "*** Testing finfo_file() : regex rules ***\n";
16
17// Calling finfo_file() with all possible arguments
18$file = __DIR__ . '/resources/test.awk';
19var_dump( finfo_file( $finfo, $file ) );
20var_dump( finfo_file( $finfo, $file, FILEINFO_CONTINUE ) );
21
22?>
23--EXPECTF--
24*** Testing finfo_file() : regex rules ***
25string(28) "text/plain; charset=us-ascii"
26string(%d) "awk%sscript, ASCII text%A"
27