Skip to content

Commit f411e7f

Browse files
authored
Fix 32-bit failure of ext-zip oo_setcompression.phpt (GH-20511)
1 parent 88d8117 commit f411e7f

File tree

2 files changed

+29
-14
lines changed

2 files changed

+29
-14
lines changed

ext/zip/tests/oo_setcompression.phpt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,12 @@ try {
3434
echo $e->getMessage(), PHP_EOL;
3535
}
3636

37-
try {
38-
$zip->setCompressionName('entry5.txt', PHP_INT_MAX);
39-
} catch (\ValueError $e) {
40-
echo $e->getMessage(), PHP_EOL;
41-
}
42-
4337
try {
4438
$zip->setCompressionIndex(4, PHP_INT_MIN);
4539
} catch (\ValueError $e) {
4640
echo $e->getMessage(), PHP_EOL;
4741
}
4842

49-
try {
50-
$zip->setCompressionIndex(4, PHP_INT_MAX);
51-
} catch (\ValueError $e) {
52-
echo $e->getMessage(), PHP_EOL;
53-
}
54-
5543
var_dump($zip->setCompressionIndex(4, ZipArchive::CM_STORE));
5644
var_dump($zip->setCompressionIndex(5, ZipArchive::CM_DEFLATE));
5745
var_dump($zip->setCompressionIndex(6, ZipArchive::CM_DEFAULT));
@@ -82,8 +70,6 @@ bool(true)
8270
bool(true)
8371
bool(true)
8472
ZipArchive::setCompressionName(): Argument #2 ($method) must be between -1 and %d
85-
ZipArchive::setCompressionName(): Argument #2 ($method) must be between -1 and %d
86-
ZipArchive::setCompressionIndex(): Argument #2 ($method) must be between -1 and %d
8773
ZipArchive::setCompressionIndex(): Argument #2 ($method) must be between -1 and %d
8874
bool(true)
8975
bool(true)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--TEST--
2+
setCompressionName and setCompressionIndex methods
3+
--EXTENSIONS--
4+
zip
5+
--SKIPIF--
6+
<?php
7+
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
8+
?>
9+
--FILE--
10+
<?php
11+
12+
$zip = new ZipArchive;
13+
14+
try {
15+
$zip->setCompressionName('entry5.txt', PHP_INT_MAX);
16+
} catch (\ValueError $e) {
17+
echo $e->getMessage(), PHP_EOL;
18+
}
19+
20+
try {
21+
$zip->setCompressionIndex(4, PHP_INT_MAX);
22+
} catch (\ValueError $e) {
23+
echo $e->getMessage(), PHP_EOL;
24+
}
25+
26+
?>
27+
--EXPECTF--
28+
ZipArchive::setCompressionName(): Argument #2 ($method) must be between -1 and %d
29+
ZipArchive::setCompressionIndex(): Argument #2 ($method) must be between -1 and %d

0 commit comments

Comments
 (0)