Skip to content

Commit 0a4d447

Browse files
author
Greg Beaver
committed
add new tests for Phar::getSupportedCompression
1 parent 5796717 commit 0a4d447

File tree

4 files changed

+78
-0
lines changed

4 files changed

+78
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--TEST--
2+
Phar::getSupportedCompression() (bz2 and zlib)
3+
--SKIPIF--
4+
<?php if (!extension_loaded("phar")) print "skip"; ?>
5+
<?php if (!extension_loaded("spl")) print "skip SPL not available"; ?>
6+
<?php if (!extension_loaded("bz2")) print "skip bz2 not available"; ?>
7+
<?php if (!extension_loaded("zlib")) print "skip zlib not available"; ?>
8+
--INI--
9+
phar.require_hash=0
10+
--FILE--
11+
<?php
12+
var_dump(Phar::getSupportedCompression());
13+
?>
14+
===DONE===
15+
--EXPECT--
16+
array(2) {
17+
[0]=>
18+
string(2) "GZ"
19+
[1]=>
20+
string(5) "BZIP2"
21+
}
22+
===DONE===
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
Phar::getSupportedCompression() (bz2)
3+
--SKIPIF--
4+
<?php if (!extension_loaded("phar")) print "skip"; ?>
5+
<?php if (!extension_loaded("spl")) print "skip SPL not available"; ?>
6+
<?php if (!extension_loaded("bz2")) print "skip bz2 not available"; ?>
7+
<?php if (extension_loaded("zlib")) print "skip zlib is available"; ?>
8+
--INI--
9+
phar.require_hash=0
10+
--FILE--
11+
<?php
12+
var_dump(Phar::getSupportedCompression());
13+
?>
14+
===DONE===
15+
--EXPECT--
16+
array(2) {
17+
[0]=>
18+
string(5) "BZIP2"
19+
}
20+
===DONE===
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
Phar::getSupportedCompression() (zlib)
3+
--SKIPIF--
4+
<?php if (!extension_loaded("phar")) print "skip"; ?>
5+
<?php if (!extension_loaded("spl")) print "skip SPL not available"; ?>
6+
<?php if (extension_loaded("bz2")) print "skip bz2 is available"; ?>
7+
<?php if (!extension_loaded("zlib")) print "skip zlib not available"; ?>
8+
--INI--
9+
phar.require_hash=0
10+
--FILE--
11+
<?php
12+
var_dump(Phar::getSupportedCompression());
13+
?>
14+
===DONE===
15+
--EXPECT--
16+
array(2) {
17+
[0]=>
18+
string(5) "GZ"
19+
}
20+
===DONE===
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
Phar::getSupportedCompression() (none)
3+
--SKIPIF--
4+
<?php if (!extension_loaded("phar")) print "skip"; ?>
5+
<?php if (!extension_loaded("spl")) print "skip SPL not available"; ?>
6+
<?php if (extension_loaded("bz2")) print "skip bz2 is available"; ?>
7+
<?php if (extension_loaded("zlib")) print "skip zlib is available"; ?>
8+
--FILE--
9+
<?php
10+
var_dump(Phar::getSupportedCompression());
11+
?>
12+
===DONE===
13+
--EXPECT--
14+
array(0) {
15+
}
16+
===DONE===

0 commit comments

Comments
 (0)