Annotation of embedaddon/php/ext/zip/tests/bug7658.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #7658 (modify archive with general bit flag 3 set)
        !             3: --SKIPIF--
        !             4: <?php
        !             5: /* $Id: bug7658.phpt 265669 2008-08-30 16:24:33Z pajoye $ */
        !             6: if(!extension_loaded('zip')) die('skip');
        !             7: ?>
        !             8: --FILE--
        !             9: <?php
        !            10: $expect = array(
        !            11:        "mimetype",
        !            12:        "Configurations2/statusbar/",
        !            13:        "Configurations2/accelerator/current.xml",
        !            14:        "Configurations2/floater/",
        !            15:        "Configurations2/popupmenu/",
        !            16:        "Configurations2/progressbar/",
        !            17:        "Configurations2/menubar/",
        !            18:        "Configurations2/toolbar/",
        !            19:        "Configurations2/images/Bitmaps/",
        !            20:        "content.xml",
        !            21:        "styles.xml",
        !            22:        "meta.xml",
        !            23:        "Thumbnails/thumbnail.png",
        !            24:        "settings.xml",
        !            25:        "META-INF/manifest.xml",
        !            26: );
        !            27: $dirname = dirname(__FILE__) . '/';
        !            28: include $dirname . 'utils.inc';
        !            29: $file = $dirname . '__tmp_bug7658.odt';
        !            30: $zip = new ZipArchive();
        !            31: copy($dirname . 'bug7658.odt', $file);
        !            32: if(!$zip->open($file)) {
        !            33:        echo 'failed';
        !            34: }
        !            35: 
        !            36: 
        !            37: $zip->deleteName('content.xml');
        !            38: $zip->addFile($dirname . "bug7658.xml","content.xml");
        !            39: $zip->close();
        !            40: echo "\n";
        !            41: $zip->open($file);
        !            42: 
        !            43: for($i=0; $i < $zip->numFiles; $i++) {
        !            44:        $sb = $zip->statIndex($i);
        !            45:        $found[] = $sb['name'];
        !            46: }
        !            47: $ar = array_diff($found, $expect);
        !            48: 
        !            49: var_dump($ar);
        !            50: unset($zip);
        !            51: unlink($file);
        !            52: ?>
        !            53: --EXPECTF--
        !            54: array(0) {
        !            55: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>