Annotation of embedaddon/php/ext/phar/tests/phar_oo_getcontents.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Phar object: getContent()
        !             3: --SKIPIF--
        !             4: <?php if (!extension_loaded("phar")) die("skip"); ?>
        !             5: <?php if (!extension_loaded("spl")) die("skip SPL not available"); ?>
        !             6: --INI--
        !             7: phar.readonly=0
        !             8: --FILE--
        !             9: <?php
        !            10: $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
        !            11: 
        !            12: $phar = new Phar($fname);
        !            13: $phar['a/b'] = 'file contents
        !            14: this works';
        !            15: $phar->addEmptyDir('hi');
        !            16: echo $phar['a/b']->getContent() . "\n";
        !            17: try {
        !            18: echo $phar['a']->getContent(), "\n";
        !            19: } catch (Exception $e) {
        !            20: echo $e->getMessage(), "\n";
        !            21: }
        !            22: try {
        !            23: echo $phar['hi']->getContent(), "\n";
        !            24: } catch (Exception $e) {
        !            25: echo $e->getMessage(), "\n";
        !            26: }
        !            27: ?>
        !            28: ===DONE===
        !            29: --CLEAN--
        !            30: <?php 
        !            31: unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php');
        !            32: __halt_compiler();
        !            33: ?>
        !            34: --EXPECTF--
        !            35: file contents
        !            36: this works
        !            37: Phar error: Cannot retrieve contents, "a" in phar "%sphar_oo_getcontents.phar.php" is a directory
        !            38: Phar error: Cannot retrieve contents, "hi" in phar "%sphar_oo_getcontents.phar.php" is a directory
        !            39: ===DONE===

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