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

1.1     ! misho       1: --TEST--
        !             2: getComment
        !             3: --SKIPIF--
        !             4: <?php
        !             5: /* $Id: oo_getcomment.phpt 260091 2008-05-21 09:27:41Z pajoye $ */
        !             6: if(!extension_loaded('zip')) die('skip');
        !             7: ?>
        !             8: --FILE--
        !             9: <?php
        !            10: $dirname = dirname(__FILE__) . '/';
        !            11: $file = $dirname . 'test_with_comment.zip';
        !            12: include $dirname . 'utils.inc';
        !            13: $zip = new ZipArchive;
        !            14: if (!$zip->open($file)) {
        !            15:        exit('failed');
        !            16: }
        !            17: echo $zip->getArchiveComment() . "\n";
        !            18: 
        !            19: $idx = $zip->locateName('foo');
        !            20: echo $zip->getCommentName('foo') . "\n";
        !            21: echo $zip->getCommentIndex($idx);
        !            22: 
        !            23: echo $zip->getCommentName('') . "\n";
        !            24: echo $zip->getCommentName() . "\n";
        !            25: 
        !            26: $zip->close();
        !            27: 
        !            28: ?>
        !            29: --EXPECTF--
        !            30: Zip archive comment
        !            31: foo comment
        !            32: foo comment
        !            33: Notice: ZipArchive::getCommentName(): Empty string as entry name in %s on line %d
        !            34: 
        !            35: 
        !            36: Warning: ZipArchive::getCommentName() expects at least 1 parameter, 0 given in %s on line %d

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