Annotation of embedaddon/php/ext/fileinfo/tests/finfo_file_regex.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test finfo_file() function : regex rules
                      3: --SKIPIF--
                      4: <?php require_once(dirname(__FILE__) . '/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 = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
                     14: $finfo = finfo_open( FILEINFO_MIME, $magicFile );
                     15: 
                     16: echo "*** Testing finfo_file() : regex rules ***\n";
                     17: 
                     18: // Calling finfo_file() with all possible arguments
                     19: $file = __DIR__ . '/resources/test.awk';
                     20: var_dump( finfo_file( $finfo, $file ) );
                     21: var_dump( finfo_file( $finfo, $file, FILEINFO_CONTINUE ) );
                     22: 
                     23: ?>
                     24: ===DONE===
                     25: --EXPECTF--
                     26: *** Testing finfo_file() : regex rules ***
                     27: string(28) "text/plain; charset=us-ascii"
                     28: string(22) "awk script, ASCII text"
                     29: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>