Commit:    dbc727373c6b9a086a4b3d28608acb6fadf7a8fd
Author:    Matt Ficken <mattfic...@php.net>         Tue, 29 May 2012 16:31:47 
+0200
Committer: Anatoliy Belsky <a...@php.net>      Tue, 29 May 2012 16:31:47 +0200
Parents:   4054890b26c4d146cfbcd56d75aab7a7aebc8c89
Branches:  PHP-5.3 PHP-5.4 master

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=dbc727373c6b9a086a4b3d28608acb6fadf7a8fd

Log:
Fix bug #62177 Test Bug - finfo_file_regex.phpt

Bugs:
https://bugs.php.net/62177

Changed paths:
  A  ext/fileinfo/tests/finfo_file_regex-win32.phpt


Diff:
diff --git a/ext/fileinfo/tests/finfo_file_regex-win32.phpt 
b/ext/fileinfo/tests/finfo_file_regex-win32.phpt
new file mode 100644
index 0000000..1eda48c
--- /dev/null
+++ b/ext/fileinfo/tests/finfo_file_regex-win32.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Test finfo_file() function : regex rules
+--SKIPIF--
+<?php require_once(dirname(__FILE__) . '/skipif.inc'); 
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+    die('skip.. only for Windows');
+}
+?>
+--FILE--
+<?php
+/**
+ * Works with the unix file command:
+ * $ file -m magic resources/test.awk
+ * resources/test.awk: awk script, ASCII text
+ */
+$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
+$finfo = finfo_open( FILEINFO_MIME, $magicFile );
+
+echo "*** Testing finfo_file() : regex rules ***\n";
+
+// Calling finfo_file() with all possible arguments
+$file = __DIR__ . '/resources/test.awk';
+var_dump( finfo_file( $finfo, $file ) );
+var_dump( finfo_file( $finfo, $file, FILEINFO_CONTINUE ) );
+
+// Windows uses libfileinfo 1.0.5-dev
+// this may be causing the slightly different output from the first
+// finfo_file() call
+
+?>
+===DONE===
+--EXPECTF--
+*** Testing finfo_file() : regex rules ***
+string(10) "text/plain"
+string(22) "awk script, ASCII text"
+===DONE===


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to