Annotation of embedaddon/php/ext/fileinfo/tests/finfo_file_basic.phpt, revision 1.1.1.2

1.1       misho       1: --TEST--
                      2: Test finfo_file() function : basic functionality 
                      3: --SKIPIF--
                      4: <?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
                      5: --FILE--
                      6: <?php
                      7: /* Prototype  : string finfo_file(resource finfo, char *file_name [, int options [, resource context]])
                      8:  * Description: Return information about a file. 
                      9:  * Source code: ext/fileinfo/fileinfo.c
                     10:  * Alias to functions: 
                     11:  */
                     12: 
                     13: $magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
                     14: $finfo = finfo_open( FILEINFO_MIME );
                     15: 
                     16: echo "*** Testing finfo_file() : basic functionality ***\n";
                     17: 
                     18: // Calling finfo_file() with all possible arguments
                     19: var_dump( finfo_file( $finfo, __FILE__) );
                     20: var_dump( finfo_file( $finfo, __FILE__, FILEINFO_CONTINUE ) );
                     21: var_dump( finfo_file( $finfo, $magicFile ) );
                     22: 
                     23: ?>
                     24: ===DONE===
                     25: --EXPECTF--
                     26: *** Testing finfo_file() : basic functionality ***
                     27: string(28) "text/x-php; charset=us-ascii"
1.1.1.2 ! misho      28: string(22) "PHP script, ASCII text"
1.1       misho      29: string(32) "text/plain; charset=unknown-8bit"
                     30: ===DONE===

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