summaryrefslogtreecommitdiff
path: root/ext/fileinfo/tests
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2012-06-14 16:02:21 +0200
committerOndřej Surý <ondrej@sury.org>2012-06-14 16:02:21 +0200
commitf0f8d7084aec4be5c07f02f2e29c2820f85c8315 (patch)
tree02e9b39d5b0088a0e27126010c96a748d824d055 /ext/fileinfo/tests
parent90ceaa9e92fadfef4c21ec0f76063c4387beb561 (diff)
downloadphp-f0f8d7084aec4be5c07f02f2e29c2820f85c8315.tar.gz
Imported Upstream version 5.4.4upstream/5.4.4
Diffstat (limited to 'ext/fileinfo/tests')
-rw-r--r--ext/fileinfo/tests/finfo_file_002.phpt4
-rw-r--r--ext/fileinfo/tests/finfo_file_regex-win32.phpt36
-rw-r--r--ext/fileinfo/tests/finfo_file_regex.phpt32
-rw-r--r--ext/fileinfo/tests/finfo_open_error-win32.phpt46
-rw-r--r--ext/fileinfo/tests/finfo_open_error.phpt5
-rw-r--r--ext/fileinfo/tests/resources/test.awk1
6 files changed, 2 insertions, 122 deletions
diff --git a/ext/fileinfo/tests/finfo_file_002.phpt b/ext/fileinfo/tests/finfo_file_002.phpt
index 3593233c3..9ed19a976 100644
--- a/ext/fileinfo/tests/finfo_file_002.phpt
+++ b/ext/fileinfo/tests/finfo_file_002.phpt
@@ -18,11 +18,9 @@ ksort($results);
var_dump($results);
?>
--EXPECTF--
-array(7) {
+array(6) {
["%s/resources/dir.zip"]=>
string(15) "application/zip"
- ["%s/resources/test.awk"]=>
- string(10) "text/plain"
["%s/resources/test.bmp"]=>
string(14) "image/x-ms-bmp"
["%s/resources/test.gif"]=>
diff --git a/ext/fileinfo/tests/finfo_file_regex-win32.phpt b/ext/fileinfo/tests/finfo_file_regex-win32.phpt
deleted file mode 100644
index 1eda48c4d..000000000
--- a/ext/fileinfo/tests/finfo_file_regex-win32.phpt
+++ /dev/null
@@ -1,36 +0,0 @@
---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===
diff --git a/ext/fileinfo/tests/finfo_file_regex.phpt b/ext/fileinfo/tests/finfo_file_regex.phpt
deleted file mode 100644
index ee4c8b0b7..000000000
--- a/ext/fileinfo/tests/finfo_file_regex.phpt
+++ /dev/null
@@ -1,32 +0,0 @@
---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 Non Windows Systems');
-}
-?>
---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 ) );
-
-?>
-===DONE===
---EXPECTF--
-*** Testing finfo_file() : regex rules ***
-string(28) "text/plain; charset=us-ascii"
-string(22) "awk script, ASCII text"
-===DONE===
diff --git a/ext/fileinfo/tests/finfo_open_error-win32.phpt b/ext/fileinfo/tests/finfo_open_error-win32.phpt
deleted file mode 100644
index bd50327b2..000000000
--- a/ext/fileinfo/tests/finfo_open_error-win32.phpt
+++ /dev/null
@@ -1,46 +0,0 @@
---TEST--
-Test finfo_open() function : error functionality
---SKIPIF--
-<?php require_once(dirname(__FILE__) . '/skipif.inc');
-if(substr(PHP_OS, 0, 3) != 'WIN' )
- die("skip Not Valid for Linux");
-?>
---FILE--
-<?php
-/* Prototype : resource finfo_open([int options [, string arg]])
- * Description: Create a new fileinfo resource.
- * Source code: ext/fileinfo/fileinfo.c
- * Alias to functions:
- */
-
-$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
-
-echo "*** Testing finfo_open() : error functionality ***\n";
-
-var_dump( finfo_open( FILEINFO_MIME, 'foobarfile' ) );
-var_dump( finfo_open( array(), $magicFile ) );
-var_dump( finfo_open( FILEINFO_MIME, $magicFile, 'extraArg' ) );
-var_dump( finfo_open( PHP_INT_MAX - 1, $magicFile ) );
-var_dump( finfo_open( 'foobar' ) );
-
-var_dump( new finfo('foobar') );
-
-?>
-===DONE===
---EXPECTF--
-*** Testing finfo_open() : error functionality ***
-bool(false)
-
-Warning: finfo_open() expects parameter 1 to be long, array given in %s on line %d
-bool(false)
-
-Warning: finfo_open() expects at most 2 parameters, 3 given in %s on line %d
-bool(false)
-resource(%d) of type (file_info)
-
-Warning: finfo_open() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d
-bool(false)
-
-Warning: finfo::finfo() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d
-NULL
-===DONE===
diff --git a/ext/fileinfo/tests/finfo_open_error.phpt b/ext/fileinfo/tests/finfo_open_error.phpt
index 5d1eff597..19ae7a601 100644
--- a/ext/fileinfo/tests/finfo_open_error.phpt
+++ b/ext/fileinfo/tests/finfo_open_error.phpt
@@ -1,10 +1,7 @@
--TEST--
Test finfo_open() function : error functionality
--SKIPIF--
-<?php require_once(dirname(__FILE__) . '/skipif.inc');
-if(substr(PHP_OS, 0, 3) == 'WIN' )
- die("skip Not Valid for Windows");
-?>
+<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--FILE--
<?php
/* Prototype : resource finfo_open([int options [, string arg]])
diff --git a/ext/fileinfo/tests/resources/test.awk b/ext/fileinfo/tests/resources/test.awk
deleted file mode 100644
index e000d5041..000000000
--- a/ext/fileinfo/tests/resources/test.awk
+++ /dev/null
@@ -1 +0,0 @@
-BEGIN { print "START" }