Annotation of embedaddon/php/ext/phar/tests/phar_oo_getcontentsgz.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar object: getContent() (verify it works with compression)
3: --SKIPIF--
4: <?php if (!extension_loaded("phar")) die("skip"); ?>
5: <?php if (!extension_loaded("spl")) die("skip SPL not available"); ?>
6: <?php if (!extension_loaded("zlib")) die("skip zlib not available"); ?>
7: --INI--
8: phar.readonly=0
9: --FILE--
10: <?php
11: $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
12: $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.2.phar.php';
13:
14: $phar = new Phar($fname);
15: $phar['a'] = 'file contents
16: this works';
17: $phar['a']->compress(Phar::GZ);
18: copy($fname, $fname2);
19: $phar2 = new Phar($fname2);
20: var_dump($phar2['a']->isCompressed());
21: echo $phar2['a']->getContent() . "\n";
22: ?>
23: ===DONE===
24: --CLEAN--
25: <?php
26: unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php');
27: unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.2.phar.php');
28: __halt_compiler();
29: ?>
30: --EXPECT--
31: bool(true)
32: file contents
33: this works
34: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>