Annotation of embedaddon/php/ext/phar/tests/zip/phar_oo_compressallgz.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar::compressFiles(Phar::GZ) zip format
3: --SKIPIF--
4: <?php if (!extension_loaded("phar")) die("skip"); ?>
5: <?php if (!extension_loaded("zlib")) die("skip zlib not present"); ?>
6: --INI--
7: phar.readonly=0
8: --FILE--
9: <?php
10: $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.zip.php';
11: $pname = 'phar://' . $fname;
12:
13: $phar = new Phar($fname);
14: $phar['a'] = 'a';
15: $phar['b'] = 'b';
16: $phar['c'] = 'c';
17:
18: var_dump(file_get_contents($pname . '/a'));
19: var_dump($phar['a']->isCompressed());
20: var_dump(file_get_contents($pname . '/b'));
21: var_dump($phar['b']->isCompressed());
22: var_dump(file_get_contents($pname . '/c'));
23: var_dump($phar['c']->isCompressed());
24:
25: $phar->compressFiles(Phar::GZ);
26: var_dump(file_get_contents($pname . '/a'));
27: var_dump($phar['a']->isCompressed(Phar::BZ2));
28: var_dump($phar['a']->isCompressed(Phar::GZ));
29: var_dump(file_get_contents($pname . '/b'));
30: var_dump($phar['b']->isCompressed(Phar::BZ2));
31: var_dump($phar['b']->isCompressed(Phar::GZ));
32: var_dump(file_get_contents($pname . '/c'));
33: var_dump($phar['b']->isCompressed(Phar::BZ2));
34: var_dump($phar['c']->isCompressed(Phar::GZ));
35:
36: ?>
37: ===DONE===
38: --CLEAN--
39: <?php
40: unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.zip.php');
41: ?>
42: --EXPECTF--
43: string(1) "a"
44: bool(false)
45: string(1) "b"
46: bool(false)
47: string(1) "c"
48: bool(false)
49: string(1) "a"
50: bool(false)
51: bool(true)
52: string(1) "b"
53: bool(false)
54: bool(true)
55: string(1) "c"
56: bool(false)
57: bool(true)
58: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>