summaryrefslogtreecommitdiff
path: root/ext/fileinfo/tests
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2017-07-30 17:52:36 +0200
committerAnatol Belski <ab@php.net>2017-07-30 17:52:36 +0200
commit03383119d2802181237175aa8834d20342f59b9a (patch)
tree20249810282cb6a12e9c918b2999b0b800c51bea /ext/fileinfo/tests
parent4db1e1adf2450878c231feab8777cdf17407d275 (diff)
parenteab66f906836b52a10abe942cd1c8b08f118c3f9 (diff)
downloadphp-git-03383119d2802181237175aa8834d20342f59b9a.tar.gz
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1: remove dup of the binary file, rely on a test runtime copy instead
Diffstat (limited to 'ext/fileinfo/tests')
-rw-r--r--ext/fileinfo/tests/67647私はガラスを食べられます.movbin144810 -> 0 bytes
-rw-r--r--ext/fileinfo/tests/bug67647-mb.phpt26
2 files changed, 24 insertions, 2 deletions
diff --git a/ext/fileinfo/tests/67647私はガラスを食べられます.mov b/ext/fileinfo/tests/67647私はガラスを食べられます.mov
deleted file mode 100644
index e119013fb1..0000000000
--- a/ext/fileinfo/tests/67647私はガラスを食べられます.mov
+++ /dev/null
Binary files differ
diff --git a/ext/fileinfo/tests/bug67647-mb.phpt b/ext/fileinfo/tests/bug67647-mb.phpt
index 611c4ab4d6..b8c82db793 100644
--- a/ext/fileinfo/tests/bug67647-mb.phpt
+++ b/ext/fileinfo/tests/bug67647-mb.phpt
@@ -1,16 +1,38 @@
--TEST--
Bug #67647: Bundled libmagic 5.17 does not detect quicktime files correctly
--SKIPIF--
-<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
+<?php
+ require_once(dirname(__FILE__) . '/skipif.inc');
+
+ if (ini_get("default_charset") != "UTF-8") {
+ die("skip require default_charset == UTF-8");
+ }
+?>
--FILE--
<?php
-$f = dirname(__FILE__) . DIRECTORY_SEPARATOR . "67647私はガラスを食べられます.mov";
+$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+++