mirror of
https://github.com/php/php-src.git
synced 2024-12-13 03:44:17 +08:00
27 lines
611 B
PHP
27 lines
611 B
PHP
--TEST--
|
|
finfo_file(): Files and directories inside an stream
|
|
--SKIPIF--
|
|
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
|
<?php if (!extension_loaded('zip')) { die("skip"); } ?>
|
|
--FILE--
|
|
<?php
|
|
|
|
$fp = finfo_open(FILEINFO_MIME_TYPE);
|
|
$results = array();
|
|
|
|
$zip = __DIR__ . "/resources/dir.zip";
|
|
$stream = "zip://" . __DIR__ . "/resources/dir.zip";
|
|
$dir = $stream . "#dir/";
|
|
$png = $stream . "#dir/test.png";
|
|
|
|
var_dump(
|
|
finfo_file($fp, $zip),
|
|
finfo_file($fp, $dir),
|
|
finfo_file($fp, $png)
|
|
);
|
|
?>
|
|
--EXPECTF--
|
|
string(15) "application/zip"
|
|
string(9) "directory"
|
|
string(9) "image/png"
|