Annotation of embedaddon/php/ext/phar/tests/tar/exists_as_phar.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar: phar-based phar named with ".tar" fails
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';
12: $tname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar';
13: $alias = 'phar://hio';
14:
15: $phar = new Phar($fname);
16: $phar['a.php'] = '<?php echo "This is a\n"; include "'.$alias.'/b.php"; ?>';
17: $phar->setAlias('hio');
18: $phar->addEmptyDir('test');
19: $phar->stopBuffering();
20: copy($fname, $tname);
21: $phar->setAlias('hio2');
22:
23: try {
24: $p = new Phar($tname);
25: } catch (Exception $e) {
26: echo $e->getMessage() . "\n";
27: }
28:
29: ?>
30: ===DONE===
31: --CLEAN--
32: <?php
33: unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.tar');
34: unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar');
35: ?>
36: --EXPECTF--
37: phar tar error: "%sexists_as_phar.phar.tar" already exists as a regular phar and must be deleted from disk prior to creating as a tar-based phar
38: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>