Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
make test simpler
  • Loading branch information
LamentXU123 committed Apr 10, 2026
commit dd45a0b149b499483d3919c1ce1acd5661db1e74
41 changes: 0 additions & 41 deletions ext/zip/tests/ZipArchive_getFromIndex_unchanged_deleted.phpt

This file was deleted.

29 changes: 29 additions & 0 deletions ext/zip/tests/bug21705.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--TEST--
ZipArchive::getFromIndex() honors FL_UNCHANGED for deleted entries
--EXTENSIONS--
zip
--FILE--
<?php
$name = __DIR__ . '/test.zip';
@unlink($name);
$zip = new ZipArchive;
$zip->open($name, ZipArchive::CREATE);
$zip->addFromString('foo.txt', 'foo');
$zip->addFromString('bar.txt', 'bar');
$zip->close();

$zip = new ZipArchive;
$zip->open($name);

$index = $zip->locateName('bar.txt');
$zip->deleteName('bar.txt');

var_dump($zip->getFromName('bar.txt', 0, ZipArchive::FL_UNCHANGED));
var_dump($zip->getFromIndex($index, 0, ZipArchive::FL_UNCHANGED)); // the ZipArchive::FL_UNCHANGED is ignored

$zip->close();
@unlink($name);
?>
--EXPECT--
string(3) "bar"
string(3) "bar"
Loading