Annotation of embedaddon/php/ext/zip/tests/bug8700.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: Bug #8700 (getFromIndex(0) fails)
3: --SKIPIF--
4: <?php
1.1.1.2 ! misho 5: /* $Id$ */
1.1 misho 6: if(!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:
15: if ($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');
20: if ($contents_from_idx != $contents_from_name) {
21: echo "failed:";
22: var_dump($content_from_idx, $content_from_name);
23: }
24:
25: $zip->close();
26: echo "status: " . $zip->status . "\n";
27: echo "\n";
28:
29: --EXPECT--
30: status: 0
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>