xref: /PHP-5.4/ext/zip/tests/bug8700.phpt (revision 1f655451)
1--TEST--
2Bug #8700 (getFromIndex(0) fails)
3--SKIPIF--
4<?php
5/* $Id$ */
6if(!extension_loaded('zip')) die('skip');
7?>
8--FILE--
9<?php
10$thisdir = dirname(__FILE__);
11$filename = $thisdir . "/bug8009.zip";
12
13$zip = new ZipArchive();
14
15if ($zip->open($filename) === FALSE) {
16       exit("cannot open $filename\n");
17}
18$contents_from_idx = $zip->getFromIndex(0);
19$contents_from_name = $zip->getFromName('1.txt');
20if ($contents_from_idx != $contents_from_name) {
21	echo "failed:";
22	var_dump($content_from_idx, $content_from_name);
23}
24
25$zip->close();
26echo "status: " . $zip->status . "\n";
27echo "\n";
28
29--EXPECT--
30status: 0
31