Skip to content

Commit 4a9fe2a

Browse files
committed
Merge branch 'PHP-8.2'
* PHP-8.2: adapt test expectation with libzip 1.10
2 parents 6dd62fb + b972af9 commit 4a9fe2a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

ext/zip/tests/oo_getstreamindex.phpt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,17 @@ fclose($fp);
3434

3535
echo "== Index, changed\n";
3636
$fp = $zip->getStreamIndex(1);
37-
var_dump($zip->status);
37+
if (version_compare(ZipArchive::LIBZIP_VERSION, "1.10.0", "<")) {
38+
/* not supported in old version */
39+
var_dump($zip->status === ZipArchive::ER_CHANGED);
40+
} else {
41+
var_dump($zip->status === 0 && stream_get_contents($fp) === "baz");
42+
}
3843
$zip->clearError();
3944

4045
echo "== Index, unchanged\n";
4146
$fp = $zip->getStreamIndex(1, ZipArchive::FL_UNCHANGED);
42-
var_dump($zip->status);
43-
var_dump(stream_get_contents($fp));
47+
var_dump($zip->status === 0 && stream_get_contents($fp) === "bar");
4448
$zip->clearError();
4549
fclose($fp);
4650

@@ -60,8 +64,7 @@ string(3) "foo"
6064
int(0)
6165
string(3) "foo"
6266
== Index, changed
63-
int(15)
67+
bool(true)
6468
== Index, unchanged
65-
int(0)
66-
string(3) "bar"
69+
bool(true)
6770
== Done

0 commit comments

Comments
 (0)