Annotation of embedaddon/php/ext/phar/tests/phar_extract3.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar: Phar::extractTo() - check that phar exists
3: --SKIPIF--
4: <?php if (!extension_loaded("phar")) die("skip"); ?>
5: --INI--
6: phar.readonly=0
7: --FILE--
8: <?php
9:
10: $fname = dirname(__FILE__) . '/files/bogus.zip';
11: $fname2 = dirname(__FILE__) . '/files/notbogus.zip';
12: $extract = dirname(__FILE__) . '/test';
13:
14: $phar = new PharData($fname);
15:
16: try {
17: $phar->extractTo($extract);
18: } catch (Exception $e) {
19: echo $e->getMessage(), "\n";
20: }
21:
22: $phar = new PharData($fname2);
23: foreach ($phar as $filename) {
24: echo "$filename\n";
25: }
26:
27: try {
28: $phar->extractTo($extract);
29: } catch (Exception $e) {
30: echo $e->getMessage(), "\n";
31: }
32:
33: ?>
34: ===DONE===
35: --CLEAN--
36: <?php
37: $dir = dirname(__FILE__) . '/test/';
38: @unlink($dir . 'stuff.txt');
39: @unlink($dir . 'nonsense.txt');
40: @rmdir($dir);
41: ?>
42: --EXPECTF--
43: Invalid argument, %sfiles/bogus.zip cannot be found
44: phar://%sfiles/notbogus.zip%cnonsense.txt
45: phar://%sfiles/notbogus.zip%cstuff.txt
46: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>