com php-src: add test for bug #57547: ext/fileinfo/tests/bug57547.phpt
| From: | Anatol Belski | Date: | Thu, 24 Nov 2016 18:25:47 +0000 |
| Subject: | com php-src: add test for bug #57547: ext/fileinfo/tests/bug57547.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-96029@lists.php.net to get a copy of this message | ||
Commit: a36dd1dfd8cf807d31aa9acc2f092b532a45bb15
Author: Anatol Belski <ab@php.net> Thu, 24 Nov 2016 19:25:47 +0100
Parents: c38f2c2a6b63effe6502f3d1b26342dd0d4be315
Branches: PHP-7.0 PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a36dd1dfd8cf807d31aa9acc2f092b532a45bb15
Log:
add test for bug #57547
Bugs:
https://bugs.php.net/57547
Changed paths:
A ext/fileinfo/tests/bug57547.phpt
Diff:
diff --git a/ext/fileinfo/tests/bug57547.phpt b/ext/fileinfo/tests/bug57547.phpt
new file mode 100644
index 0000000..512d4c0
--- /dev/null
+++ b/ext/fileinfo/tests/bug57547.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Bug #57547 Settings options on file doesn't give same result as constructor options
+--SKIPIF--
+<?php
+if (!class_exists('finfo'))
+ die('skip no fileinfo extension');
+--FILE--
+<?php
+
+$filenames = array("..", __FILE__);
+
+foreach ($filenames as $filename) {
+ $finfo = new finfo(FILEINFO_MIME);
+ var_dump($finfo->file($filename));
+
+ $finfo2 = new finfo();
+ var_dump($finfo2->file($filename, FILEINFO_MIME));
+}
+
+?>
+===DONE===
+--EXPECT--
+string(9) "directory"
+string(9) "directory"
+string(28) "text/x-php; charset=us-ascii"
+string(28) "text/x-php; charset=us-ascii"
+===DONE===