From 92153dcfe3f7643526572439622408d94fd4aa14 Mon Sep 17 00:00:00 2001 From: Anatoliy Belsky Date: Tue, 21 Aug 2012 13:22:00 +0200 Subject: [PATCH] Added test for bug #51353. It'll be skipped by default and must be activated manually. --- ext/zip/tests/bug51353.phpt | 54 +++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 ext/zip/tests/bug51353.phpt diff --git a/ext/zip/tests/bug51353.phpt b/ext/zip/tests/bug51353.phpt new file mode 100644 index 0000000000..560945f9dd --- /dev/null +++ b/ext/zip/tests/bug51353.phpt @@ -0,0 +1,54 @@ +--TEST-- +Bug #51353 ZIP64 problem, archive with 100000 items +--SKIPIF-- +12M big, + or create it dynamically. */ +$zip = new ZipArchive; +$r = $zip->open("$base_path/51353.zip", ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE); +if ($r) { + for ($i = 0; $i < 100000; $i++) { + $zip->addFromString("$i.txt", '1'); + } + $zip->close(); +} else { + die("failed"); +} + +$zip = new ZipArchive; +$r = $zip->open("$base_path/51353.zip"); +if ($r) { + $zip->extractTo("$base_path/51353_unpack"); + $zip->close(); + + $a = glob("$base_path/51353_unpack/*.txt"); + echo count($a) . "\n"; +} else { + die("failed"); +} + +echo "OK"; +--CLEAN-- +