com php-src: Add test for bug #69107: finfo no longer detects PHP files: ext/fileinfo/tests/bug69107.phpt

From: Date: Mon, 08 Aug 2016 16:43:33 +0000
Subject: com php-src: Add test for bug #69107: finfo no longer detects PHP files: ext/fileinfo/tests/bug69107.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-93674@lists.php.net to get a copy of this message
Commit: 243d5fcb1f070025fa19a5e31a3d8d64c8d1a1e6 Author: Christoph M. Becker <cmbecker69@gmx.de> Mon, 8 Aug 2016 18:43:33 +0200 Parents: 40d237df1f3f556394a100e052c8fb4d05fd1893 Branches: PHP-5.6 PHP-7.0 PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=243d5fcb1f070025fa19a5e31a3d8d64c8d1a1e6 Log: Add test for bug #69107: finfo no longer detects PHP files Bugs: https://bugs.php.net/69107 Changed paths: A ext/fileinfo/tests/bug69107.phpt Diff: diff --git a/ext/fileinfo/tests/bug69107.phpt b/ext/fileinfo/tests/bug69107.phpt new file mode 100644 index 0000000..9a7b26b --- /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===

« previous php.cvs (#93674) next »