Annotation of embedaddon/php/ext/phar/tests/phar_bz2.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar: bzipped phar
3: --SKIPIF--
4: <?php
5: if (!extension_loaded("phar")) die("skip");
6: if (!extension_loaded("spl")) die("skip SPL not available");
7: if (!extension_loaded("bz2")) die("skip bz2 not available");
8: ?>
9: --INI--
10: phar.readonly=0
11: phar.require_hash=0
12: --FILE--
13: <?php
14: $fname = dirname(__FILE__) . '/phar_bz2.phar';
15: $pname = 'phar://' . $fname;
16: $fname2 = dirname(__FILE__) . '/phar_bz2.2.phar';
17: $pname2 = 'phar://' . $fname2;
18:
19: $file = '<?php
20: Phar::mapPhar();
21: var_dump("it worked");
22: include "phar://" . __FILE__ . "/tar_004.php";
23: __HALT_COMPILER();';
24:
25: $files = array();
26: $files['tar_004.php'] = '<?php var_dump(__FILE__);';
27: $files['internal/file/here'] = "hi there!\n";
28: $files['internal/dir/'] = '';
29: $files['dir/'] = '';
30: $bz2 = true;
31:
32: include 'files/phar_test.inc';
33:
34: include $fname;
35:
36: $a = new Phar($fname);
37: $a['test'] = 'hi';
38: copy($fname, $fname2);
39: $a->setAlias('another');
40: $b = new Phar($fname2);
41: var_dump($b->isFileFormat(Phar::PHAR));
42: var_dump($b->isCompressed() == Phar::BZ2);
43: // additional code coverage
44: $b->isFileFormat(array());
45: try {
46: $b->isFileFormat(25);
47: } catch (Exception $e) {
48: echo $e->getMessage(),"\n";
49: }
50: ?>
51: ===DONE===
52: --CLEAN--
53: <?php
54: @unlink(dirname(__FILE__) . '/phar_bz2.phar');
55: @unlink(dirname(__FILE__) . '/phar_bz2.2.phar');
56: ?>
57: --EXPECTF--
58: %unicode|string%(9) "it worked"
59: %unicode|string%(%d) "phar://%sphar_bz2.phar/tar_004.php"
60: bool(true)
61: bool(true)
62:
63: Warning: Phar::isFileFormat() expects parameter 1 to be long, array given in %sphar_bz2.php on line %d
64: Unknown file format specified
65: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>