diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-01-28 10:32:26 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-01-28 10:33:10 +0100 |
commit | e197f65b354c37aa4a78c0cf02fab687cace5794 (patch) | |
tree | 8830599b9b84d49704f64b659b6dd642661f9b2f /ext/phar/tests | |
parent | 412b476b7fb386c6aa04efb936881f5b2250ded9 (diff) | |
parent | 136f51f1e1ce25a7d0150857d0846be8c8415a44 (diff) | |
download | php-git-e197f65b354c37aa4a78c0cf02fab687cace5794.tar.gz |
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Fix #76584: PharFileInfo::decompress not working
Diffstat (limited to 'ext/phar/tests')
-rw-r--r-- | ext/phar/tests/bug76584.phpt | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/ext/phar/tests/bug76584.phpt b/ext/phar/tests/bug76584.phpt new file mode 100644 index 0000000000..b37de08c49 --- /dev/null +++ b/ext/phar/tests/bug76584.phpt @@ -0,0 +1,35 @@ +--TEST-- +Bug #76584 (PharFileInfo::decompress not working) +--SKIPIF-- +<?php +if (!extension_loaded('phar')) die('skip phar extension not available'); +if (!extension_loaded('zlib')) die('skip zlib extension not available'); +?> +--INI-- +phar.readonly=0 +--FILE-- +<?php +$phar = new Phar(__DIR__ . '/76584.phar'); +$phar->addFromString('76584.txt', 'This is a test file.'); +$file = $phar['76584.txt']; +var_dump($file->compress(Phar::GZ)); +var_dump($file->isCompressed()); +var_dump($file->decompress()); +var_dump($file->isCompressed()); +mkdir(__DIR__ . '/76584'); +var_dump($phar->extractTo(__DIR__ . '/76584')); +echo file_get_contents(__DIR__ . '/76584/76584.txt'); +?> +--EXPECT-- +bool(true) +bool(true) +bool(true) +bool(false) +bool(true) +This is a test file. +--CLEAN-- +<?php +unlink(__DIR__ . '/76584/76584.txt'); +rmdir(__DIR__ . '/76584'); +unlink(__DIR__ . '/76584.phar'); +?> |