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

1.1     ! misho       1: --TEST--
        !             2: Phar: rename test zip-based
        !             3: --SKIPIF--
        !             4: <?php if (!extension_loaded("phar")) die("skip"); ?>
        !             5: --INI--
        !             6: phar.readonly=0
        !             7: phar.require_hash=0
        !             8: --FILE--
        !             9: <?php
        !            10: 
        !            11: $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.zip';
        !            12: $alias = 'phar://' . $fname;
        !            13: 
        !            14: $phar = new Phar($fname);
        !            15: $phar->setStub("<?php
        !            16: Phar::mapPhar('hio');
        !            17: __HALT_COMPILER(); ?>");
        !            18: $phar['a'] = 'a';
        !            19: $phar->stopBuffering();
        !            20: 
        !            21: include $fname;
        !            22: 
        !            23: echo file_get_contents($alias . '/a') . "\n";
        !            24: rename($alias . '/a', $alias . '/b');
        !            25: echo file_get_contents($alias . '/b') . "\n";
        !            26: echo file_get_contents($alias . '/a') . "\n";
        !            27: ?>
        !            28: --CLEAN--
        !            29: <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.zip'); ?>
        !            30: --EXPECTF--
        !            31: a
        !            32: a
        !            33: 
        !            34: Warning: file_get_contents(phar://%srename.phar.zip/a): failed to open stream: phar error: "a" is not a file in phar "%srename.phar.zip" in %srename.php on line %d

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