diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-03-14 05:42:27 +0000 |
---|---|---|
committer | <> | 2013-04-03 16:25:08 +0000 |
commit | c4dd7a1a684490673e25aaf4fabec5df138854c4 (patch) | |
tree | 4d57c44caae4480efff02b90b9be86f44bf25409 /ext/fileinfo/tests/finfo_file_regex.phpt | |
download | php2-master.tar.gz |
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/fileinfo/tests/finfo_file_regex.phpt')
-rw-r--r-- | ext/fileinfo/tests/finfo_file_regex.phpt | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/ext/fileinfo/tests/finfo_file_regex.phpt b/ext/fileinfo/tests/finfo_file_regex.phpt new file mode 100644 index 0000000..7d9cd3a --- /dev/null +++ b/ext/fileinfo/tests/finfo_file_regex.phpt @@ -0,0 +1,29 @@ +--TEST-- +Test finfo_file() function : regex rules +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); +?> +--FILE-- +<?php +/** + * Works with the unix file command: + * $ file -m magic resources/test.awk + * resources/test.awk: awk script, ASCII text + */ +$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic'; +$finfo = finfo_open( FILEINFO_MIME, $magicFile ); + +echo "*** Testing finfo_file() : regex rules ***\n"; + +// Calling finfo_file() with all possible arguments +$file = __DIR__ . '/resources/test.awk'; +var_dump( finfo_file( $finfo, $file ) ); +var_dump( finfo_file( $finfo, $file, FILEINFO_CONTINUE ) ); + +?> +===DONE=== +--EXPECTF-- +*** Testing finfo_file() : regex rules *** +string(28) "text/plain; charset=us-ascii" +string(22) "awk script, ASCII text" +===DONE=== |