Annotation of embedaddon/php/ext/phar/tests/bug52013.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test for bug 52013 about Phar::decompressFiles().
! 3: --DESCRIPTION--
! 4: Test for a bug where Phar::decompressFiles() mistakenly throws BadMethodCallException.
! 5: http://bugs.php.net/bug.php?id=52013
! 6: --CREDITS--
! 7: Frederic Hardy frederic.hardy@mageekbox.net
! 8: --SKIPIF--
! 9: <?php
! 10: if (!extension_loaded("phar")) die("skip");
! 11: if (!extension_loaded("zlib")) die("skip test needs zlib extension enabled to compress archives with gzip");
! 12: ?>
! 13: --INI--
! 14: phar.require_hash=0
! 15: phar.readonly=0
! 16: open_basedir=
! 17: --FILE--
! 18: <?php
! 19: mkdir(dirname(__FILE__) . '/testdir');
! 20: file_put_contents(dirname(__FILE__) . '/testdir/1.php', str_repeat(' ', 1455));
! 21:
! 22: $phar = new Phar(dirname(__FILE__) . '/compressed.phar');
! 23: $phar->buildFromDirectory(dirname(__FILE__) . '/testdir', '/\.php$/');
! 24: $phar->setSignatureAlgorithm(Phar::SHA1);
! 25: $phar->compressFiles(Phar::GZ);
! 26: $phar->decompressFiles();
! 27:
! 28: echo 'ok';
! 29: ?>
! 30: --CLEAN--
! 31: <?php
! 32: if (is_file(dirname(__FILE__) . '/testdir/1.php'))
! 33: unlink(dirname(__FILE__) . '/testdir/1.php');
! 34: if (is_dir(dirname(__FILE__) . '/testdir'))
! 35: rmdir(dirname(__FILE__) . '/testdir');
! 36: if (is_file(dirname(__FILE__) . '/compressed.phar'))
! 37: unlink(dirname(__FILE__) . '/compressed.phar');
! 38: ?>
! 39: --EXPECT--
! 40: ok
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>