xref: /PHP-8.0/ext/fileinfo/tests/bug67647-mb.phpt (revision c5401854)
1--TEST--
2Bug #67647: Bundled libmagic 5.17 does not detect quicktime files correctly
3--SKIPIF--
4<?php
5    require_once(__DIR__ . '/skipif.inc');
6
7    if (ini_get("default_charset") != "UTF-8") {
8        die("skip require default_charset == UTF-8");
9    }
10?>
11--FILE--
12<?php
13
14$src = __DIR__ . DIRECTORY_SEPARATOR . "67647.mov";
15
16$f_base = "67647私はガラスを食べられます.mov";
17$f = __DIR__ . DIRECTORY_SEPARATOR . $f_base;
18
19/* Streams mb path support is tested a lot elsewhere. Copy the existing file
20    therefore, avoid duplication in the repo. */
21if (!copy($src, $f) || empty(glob($f))) {
22    die("failed to copy '$src' to '$f'");
23}
24
25$fi = new finfo(FILEINFO_MIME_TYPE);
26var_dump($fi->file($f));
27
28?>
29+++DONE+++
30--CLEAN--
31<?php
32    $f_base = "67647私はガラスを食べられます.mov";
33    $f = __DIR__ . DIRECTORY_SEPARATOR . $f_base;
34    unlink($f);
35?>
36--EXPECT--
37string(15) "video/quicktime"
38+++DONE+++
39