php-src/ext/phar/tests/phar_extract3.phpt
Steph Fox 6895773aff - Utilize new UNIX_PATHS flag in SPL
- Fix tests

@Jani: hold back on the bunny-killing, HEAD will be in sync later today
2008-07-24 09:22:35 +00:00

47 lines
910 B
PHP

--TEST--
Phar: Phar::extractTo() - check that phar exists
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--INI--
phar.readonly=0
--FILE--
<?php
$fname = dirname(__FILE__) . '/files/bogus.zip';
$fname2 = dirname(__FILE__) . '/files/notbogus.zip';
$extract = dirname(__FILE__) . '/test';
$phar = new PharData($fname);
try {
$phar->extractTo($extract);
} catch (Exception $e) {
echo $e->getMessage(), "\n";
}
$phar = new PharData($fname2);
foreach ($phar as $filename) {
echo "$filename\n";
}
try {
$phar->extractTo($extract);
} catch (Exception $e) {
echo $e->getMessage(), "\n";
}
?>
===DONE===
--CLEAN--
<?php
$dir = dirname(__FILE__) . '/test/';
@unlink($dir . 'stuff.txt');
@unlink($dir . 'nonsense.txt');
@rmdir($dir);
?>
--EXPECTF--
Invalid argument, %sfiles/bogus.zip cannot be found
phar://%sfiles/notbogus.zip/nonsense.txt
phar://%sfiles/notbogus.zip/stuff.txt
===DONE===