xref: /PHP-7.3/ext/phar/tests/tar/tar_makegz.phpt (revision f1d7e3ca)
1--TEST--
2Phar: tar-based phar, make new gzipped tar
3--SKIPIF--
4<?php if (!extension_loaded('phar')) die('skip'); ?>
5<?php if (!extension_loaded("zlib")) die("skip zlib not available"); ?>
6--INI--
7phar.readonly=0
8--FILE--
9<?php
10
11$fname = dirname(__FILE__) . '/tar_makegz.phar.tar';
12$fname2 = dirname(__FILE__) . '/tar_makegz.phar.tar.gz';
13$fname3 = dirname(__FILE__) . '/tar_makegz_b.phar.tar.gz';
14
15$phar = new Phar($fname);
16$phar['test'] = 'hi';
17var_dump($phar->isFileFormat(Phar::TAR));
18$phar = $phar->compress(Phar::GZ);
19
20
21copy($fname2, $fname3);
22
23$phar2 = new Phar($fname3);
24var_dump($phar2->isFileFormat(Phar::TAR));
25var_dump($phar2->isCompressed() == Phar::GZ);
26
27?>
28===DONE===
29--CLEAN--
30<?php
31@unlink(dirname(__FILE__) . '/tar_makegz.phar.gz');
32@unlink(dirname(__FILE__) . '/tar_makegz.phar.tar');
33@unlink(dirname(__FILE__) . '/tar_makegz.phar.tar.gz');
34@unlink(dirname(__FILE__) . '/tar_makegz_b.phar.tar.gz');
35?>
36--EXPECT--
37bool(true)
38bool(true)
39bool(true)
40===DONE===
41