Annotation of embedaddon/php/ext/phar/tests/open_for_write_newfile.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Phar: fopen a .phar for writing (new file)
! 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: $fp = fopen($pname . '/b/new.php', 'wb');
! 21: fwrite($fp, b'extra');
! 22: fclose($fp);
! 23: include $pname . '/b/c.php';
! 24: include $pname . '/b/new.php';
! 25: ?>
! 26:
! 27: ===DONE===
! 28: --CLEAN--
! 29: <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
! 30: --EXPECT--
! 31: This is b/c
! 32: extra
! 33: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>