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