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

1.1     ! misho       1: --TEST--
        !             2: Bug #14962 (::extractTo second argument is not really optional)
        !             3: --SKIPIF--
        !             4: <?php
        !             5: /* $Id: bug14962.phpt 268855 2008-11-12 11:41:21Z pajoye $ */
        !             6: if(!extension_loaded('zip')) die('skip');
        !             7: ?>
        !             8: --FILE--
        !             9: <?php
        !            10: 
        !            11: $dir = dirname(__FILE__);
        !            12: $file = '__tmp14962.txt';
        !            13: $fullpath = $dir . '/' . $file;
        !            14: $za = new ZipArchive;
        !            15: $za->open($dir . '/__14962.zip', ZIPARCHIVE::CREATE);
        !            16: $za->addFromString($file, '1234');
        !            17: $za->close();
        !            18: 
        !            19: if (!is_file($dir . "/__14962.zip")) {
        !            20:        die('failed to create the archive');
        !            21: }
        !            22: $za = new ZipArchive;
        !            23: $za->open($dir . '/__14962.zip');
        !            24: $za->extractTo($dir, NULL);
        !            25: $za->close();
        !            26: 
        !            27: if (is_file($fullpath)) {
        !            28:        unlink($fullpath);
        !            29:        echo "Ok";
        !            30: }
        !            31: unlink($dir . '/' . '__14962.zip');
        !            32: ?>
        !            33: --EXPECT--
        !            34: Ok

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