source: src/router/php7/ext/fileinfo/tests/finfo_set_flags_basic-mb.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 2 months ago

update php

File size: 1.2 KB
Line 
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===
Note: See TracBrowser for help on using the repository browser.