1--TEST-- 2Test finfo_set_flags() function : basic functionality 3--SKIPIF-- 4<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> 5--FILE-- 6<?php 7/* Prototype : bool finfo_set_flags(resource finfo, int options) 8 * Description: Set libmagic configuration options. 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, $magicFile ); 15 16echo "*** Testing finfo_set_flags() : basic functionality ***\n"; 17 18var_dump( finfo_set_flags( $finfo, FILEINFO_NONE ) ); 19var_dump( finfo_set_flags( $finfo, FILEINFO_SYMLINK ) ); 20var_dump( finfo_set_flags() ); 21 22finfo_close( $finfo ); 23 24// OO way 25$finfo = new finfo( FILEINFO_NONE, $magicFile ); 26var_dump( $finfo->set_flags( FILEINFO_MIME ) ); 27var_dump( $finfo->set_flags() ); 28 29?> 30===DONE=== 31--EXPECTF-- 32*** Testing finfo_set_flags() : basic functionality *** 33bool(true) 34bool(true) 35 36Warning: finfo_set_flags() expects exactly 2 parameters, 0 given in %s on line %d 37bool(false) 38bool(true) 39 40Warning: finfo::set_flags() expects exactly 1 parameter, 0 given in %s on line %d 41bool(false) 42===DONE=== 43