From a3e723b935bd6b30b539a0822ac4ce8463c5038c Mon Sep 17 00:00:00 2001 From: Greg Beaver Date: Wed, 16 Apr 2008 20:15:19 +0000 Subject: [PATCH] add failing tests for compression of zip files internally --- .../tests/zip/phar_oo_compressallbz2.phpt | 58 +++++++++++++++++++ ext/phar/tests/zip/phar_oo_compressallgz.phpt | 58 +++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 ext/phar/tests/zip/phar_oo_compressallbz2.phpt create mode 100644 ext/phar/tests/zip/phar_oo_compressallgz.phpt diff --git a/ext/phar/tests/zip/phar_oo_compressallbz2.phpt b/ext/phar/tests/zip/phar_oo_compressallbz2.phpt new file mode 100644 index 0000000000..964bce50b1 --- /dev/null +++ b/ext/phar/tests/zip/phar_oo_compressallbz2.phpt @@ -0,0 +1,58 @@ +--TEST-- +Phar::compressFiles(Phar::BZ2) zip format +--SKIPIF-- + + +--INI-- +phar.readonly=0 +--FILE-- +isCompressed()); +var_dump(file_get_contents($pname . '/b')); +var_dump($phar['b']->isCompressed()); +var_dump(file_get_contents($pname . '/c')); +var_dump($phar['c']->isCompressed()); + +$phar->compressFiles(Phar::BZ2); +var_dump(file_get_contents($pname . '/a')); +var_dump($phar['a']->isCompressed(Phar::GZ)); +var_dump($phar['a']->isCompressed(Phar::BZ2)); +var_dump(file_get_contents($pname . '/b')); +var_dump($phar['b']->isCompressed(Phar::GZ)); +var_dump($phar['b']->isCompressed(Phar::BZ2)); +var_dump(file_get_contents($pname . '/c')); +var_dump($phar['c']->isCompressed(Phar::GZ)); +var_dump($phar['b']->isCompressed(Phar::BZ2)); + +?> +===DONE=== +--CLEAN-- + +--EXPECTF-- +string(1) "a" +bool(false) +string(1) "b" +bool(false) +string(1) "c" +bool(false) +string(1) "a" +bool(false) +bool(true) +string(1) "b" +bool(false) +bool(true) +string(1) "c" +bool(false) +bool(true) +===DONE=== diff --git a/ext/phar/tests/zip/phar_oo_compressallgz.phpt b/ext/phar/tests/zip/phar_oo_compressallgz.phpt new file mode 100644 index 0000000000..47dddac487 --- /dev/null +++ b/ext/phar/tests/zip/phar_oo_compressallgz.phpt @@ -0,0 +1,58 @@ +--TEST-- +Phar::compressFiles(Phar::GZ) zip format +--SKIPIF-- + + +--INI-- +phar.readonly=0 +--FILE-- +isCompressed()); +var_dump(file_get_contents($pname . '/b')); +var_dump($phar['b']->isCompressed()); +var_dump(file_get_contents($pname . '/c')); +var_dump($phar['c']->isCompressed()); + +$phar->compressFiles(Phar::GZ); +var_dump(file_get_contents($pname . '/a')); +var_dump($phar['a']->isCompressed(Phar::BZ2)); +var_dump($phar['a']->isCompressed(Phar::GZ)); +var_dump(file_get_contents($pname . '/b')); +var_dump($phar['b']->isCompressed(Phar::BZ2)); +var_dump($phar['b']->isCompressed(Phar::GZ)); +var_dump(file_get_contents($pname . '/c')); +var_dump($phar['b']->isCompressed(Phar::BZ2)); +var_dump($phar['c']->isCompressed(Phar::GZ)); + +?> +===DONE=== +--CLEAN-- + +--EXPECTF-- +string(1) "a" +bool(false) +string(1) "b" +bool(false) +string(1) "c" +bool(false) +string(1) "a" +bool(false) +bool(true) +string(1) "b" +bool(false) +bool(true) +string(1) "c" +bool(false) +bool(true) +===DONE=== -- 2.40.0