Annotation of embedaddon/php/ext/phar/tests/delete_in_phar_confirm.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Phar: delete a file within a .phar (confirm disk file is changed)
! 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: $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
! 11: $pname = 'phar://' . $fname;
! 12: $file = "<?php __HALT_COMPILER(); ?>";
! 13:
! 14: $files = array();
! 15: $files['a.php'] = '<?php echo "This is a\n"; ?>';
! 16: $files['b.php'] = '<?php echo "This is b\n"; ?>';
! 17: $files['b/c.php'] = '<?php echo "This is b/c\n"; ?>';
! 18: include 'files/phar_test.inc';
! 19:
! 20: include $pname . '/a.php';
! 21: include $pname . '/b.php';
! 22: include $pname . '/b/c.php';
! 23: $md5 = md5_file($fname);
! 24: unlink($pname . '/b/c.php');
! 25: clearstatcache();
! 26: $md52 = md5_file($fname);
! 27: if ($md5 == $md52) echo 'file was not modified';
! 28: ?>
! 29: ===AFTER===
! 30: <?php
! 31: include 'phar://' . dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php/a.php';
! 32: include 'phar://' . dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php/b.php';
! 33: include 'phar://' . dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php/b/c.php';
! 34: ?>
! 35:
! 36: ===DONE===
! 37: --CLEAN--
! 38: <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
! 39: --EXPECTF--
! 40: This is a
! 41: This is b
! 42: This is b/c
! 43: ===AFTER===
! 44: This is a
! 45: This is b
! 46:
! 47: Warning: include(%sdelete_in_phar_confirm.phar.php/b/c.php): failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar_confirm.phar.php" in %sdelete_in_phar_confirm.php on line %d
! 48:
! 49: Warning: include(): Failed opening 'phar://%sdelete_in_phar_confirm.phar.php/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar_confirm.php on line %d
! 50:
! 51: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>