Skip to content

Commit

Permalink
adapt test expectation with libzip 1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
remicollet committed Jun 26, 2023
1 parent 776a685 commit b972af9
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions ext/zip/tests/oo_getstreamindex.phpt
Expand Up @@ -34,13 +34,17 @@ fclose($fp);

echo "== Index, changed\n";
$fp = $zip->getStreamIndex(1);
var_dump($zip->status);
if (version_compare(ZipArchive::LIBZIP_VERSION, "1.10.0", "<")) {
/* not supported in old version */
var_dump($zip->status === ZipArchive::ER_CHANGED);
} else {
var_dump($zip->status === 0 && stream_get_contents($fp) === "baz");
}
$zip->clearError();

echo "== Index, unchanged\n";
$fp = $zip->getStreamIndex(1, ZipArchive::FL_UNCHANGED);
var_dump($zip->status);
var_dump(stream_get_contents($fp));
var_dump($zip->status === 0 && stream_get_contents($fp) === "bar");
$zip->clearError();
fclose($fp);

Expand All @@ -60,8 +64,7 @@ string(3) "foo"
int(0)
string(3) "foo"
== Index, changed
int(15)
bool(true)
== Index, unchanged
int(0)
string(3) "bar"
bool(true)
== Done

0 comments on commit b972af9

Please sign in to comment.