summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2016-08-08 18:43:33 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2016-08-08 18:43:33 +0200
commit243d5fcb1f070025fa19a5e31a3d8d64c8d1a1e6 (patch)
treefa79eaeef80c7585560d4363b667a51eda388f59 /ext
parent40d237df1f3f556394a100e052c8fb4d05fd1893 (diff)
downloadphp-git-243d5fcb1f070025fa19a5e31a3d8d64c8d1a1e6.tar.gz
Add test for bug #69107: finfo no longer detects PHP files
Diffstat (limited to 'ext')
-rw-r--r--ext/fileinfo/tests/bug69107.phpt22
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/fileinfo/tests/bug69107.phpt b/ext/fileinfo/tests/bug69107.phpt
new file mode 100644
index 0000000000..9a7b26b5d1
--- /dev/null
+++ b/ext/fileinfo/tests/bug69107.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #69107 (finfo no longer detects PHP files)
+--SKIPIF--
+<?php
+if (!extension_loaded('fileinfo')) die('skip fileinfo extension not available');
+?>
+--FILE--
+<?php
+$finfo = new finfo(FILEINFO_MIME_TYPE);
+
+var_dump($finfo->buffer("<?php\nclass A{}"));
+var_dump($finfo->buffer("<?php class A{}"));
+var_dump($finfo->buffer("<?php\tclass A{}"));
+var_dump($finfo->buffer("<?php\n\rclass A{}"));
+?>
+===DONE===
+--EXPECT--
+string(10) "text/x-php"
+string(10) "text/x-php"
+string(10) "text/x-php"
+string(10) "text/x-php"
+===DONE===