summaryrefslogtreecommitdiff
path: root/ext/fileinfo/tests/bug67647-mb.phpt
blob: b8c82db793a282be5557e54d39de0e2263ded872 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--TEST--
Bug #67647: Bundled libmagic 5.17 does not detect quicktime files correctly
--SKIPIF--
<?php
	require_once(dirname(__FILE__) . '/skipif.inc');

	if (ini_get("default_charset") != "UTF-8") {
		die("skip require default_charset == UTF-8");
	}
?>
--FILE--
<?php

$src = dirname(__FILE__) . DIRECTORY_SEPARATOR . "67647.mov";

$f_base = "67647私はガラスを食べられます.mov";
$f = dirname(__FILE__) . DIRECTORY_SEPARATOR . $f_base;

/* Streams mb path support is tested a lot elsewhere. Copy the existing file
	therefore, avoid duplication in the repo. */
if (!copy($src, $f) || empty(glob($f))) {
	die("failed to copy '$src' to '$f'");
}

$fi = new finfo(FILEINFO_MIME_TYPE);
var_dump($fi->file($f));

?>
+++DONE+++
--CLEAN--
<?php
	$f_base = "67647私はガラスを食べられます.mov";
	$f = dirname(__FILE__) . DIRECTORY_SEPARATOR . $f_base;
	unlink($f);
?>
--EXPECT--
string(15) "video/quicktime"
+++DONE+++