Annotation of embedaddon/php/ext/phar/tests/tar/delete.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Phar: delete test, tar-based phar
                      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.tar';
                     12: $alias = 'phar://' . $fname;
                     13: $stub = "<?php
                     14: Phar::mapPhar('hio');
                     15: __HALT_COMPILER(); ?>";
                     16: 
                     17: $phar = new Phar($fname);
                     18: $phar['a'] = 'a';
                     19: $phar->setStub($stub);
                     20: $phar->stopBuffering();
                     21: 
                     22: echo file_get_contents($alias . '/a') . "\n";
                     23: $phar->delete('a');
                     24: echo file_get_contents($alias . '/a') . "\n";
                     25: 
                     26: ?>
                     27: --CLEAN--
                     28: <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.tar'); ?>
                     29: --EXPECTF--
                     30: a
                     31: 
                     32: Warning: file_get_contents(phar://%sdelete.phar.tar/a): failed to open stream: phar error: "a" is not a file in phar "%sdelete.phar.tar" in %sdelete.php on line %d

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