Skip to content

Commit 34bdab5

Browse files
committed
fileinfo: Pull upstream tests
Integrating the upstream tests is important to ensure the quality of the patch and to ensure the parity in the function. Signed-off-by: Anatol Belski <[email protected]>
1 parent 0c3f707 commit 34bdab5

File tree

86 files changed

+178
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+178
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
--TEST--
2+
Fileinfo run upstream tests
3+
--EXTENSIONS--
4+
fileinfo
5+
--ENV--
6+
TZ=UTC
7+
--FILE--
8+
<?php
9+
10+
$lst = glob(__DIR__ . DIRECTORY_SEPARATOR . "upstream/*.testfile");
11+
12+
foreach($lst as $p) {
13+
$mp = dirname($p) . DIRECTORY_SEPARATOR . basename($p, ".testfile") . ".magic";
14+
$tp = dirname($p) . DIRECTORY_SEPARATOR . basename($p, ".testfile") . ".result";
15+
$finfo = finfo_open(FILEINFO_NONE, file_exists($mp) ? $mp : NULL);
16+
$i = finfo_file( $finfo, $p);
17+
$exp = file_get_contents($tp);
18+
if ($i !== $exp) {
19+
echo "'$p' failed\nexp: '$exp'\ngot: '$i'\n";
20+
}
21+
finfo_close($finfo);
22+
}
23+
24+
echo "==DONE==";
25+
?>
26+
--EXPECT--
27+
==DONE==
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Apple Driver Map, blocksize 0
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Audio file with ID3 version 2.2.0, contains:MPEG ADTS, layer III, v1, 96 kbps, 44.1 kHz, Monaural
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Zip data (MIME type "application/vnd.nz.gen.geek_central.ti5x"?)
8.61 KB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FIT Map data, unit id 65536, serial 3879446968, Sat May 31 10:00:34 2014, manufacturer 1 (garmin), product 1632, type 4 (Activity)
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
GEDCOM genealogy text version 5.5, ASCII text

0 commit comments

Comments
 (0)