From: Greg Beaver Date: Tue, 16 Jan 2007 03:21:55 +0000 (+0000) Subject: failing test that demonstrates existing file pointer and PharFileInfo don't respond... X-Git-Tag: RELEASE_1_0_0RC1~256 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=36c1d32bde7a9a337d7bed026b779ff484901c5b;p=php failing test that demonstrates existing file pointer and PharFileInfo don't respond to changes in the underlying file --- diff --git a/ext/phar/tests/refcount1.phpt b/ext/phar/tests/refcount1.phpt new file mode 100644 index 0000000000..bafdc86956 --- /dev/null +++ b/ext/phar/tests/refcount1.phpt @@ -0,0 +1,43 @@ +--TEST-- +Phar: test that refcounting avoids problems with deleting a file +--SKIPIF-- + +--INI-- +phar.readonly=0 +phar.require_hash=0 +--FILE-- +"; + +$files = array(); +$files['a.php'] = ''; +$files['b.php'] = ''; +$files['b/c.php'] = ''; +include 'phar_test.inc'; + +$fp = fopen($pname . '/b/c.php', 'wb'); +fwrite($fp, "extra\n"); +fclose($fp); +$p = new Phar($fname); +$b = fopen($pname . '/b/c.php', 'rb'); +$a = $p['b/c.php']; +echo $a; +echo fread($b, 20); +rewind($b); +unlink($pname . '/b/c.php'); +echo $a; +echo fread($b, 20); +include $pname . '/b/c.php'; +?> + +===DONE=== +--CLEAN-- + +--EXPECTF-- +extra +extra + +Warning: include(): Failed opening 'phar://%s/b/c.php): for inclusion (include_path='%s') in %s on line 27 +===DONE===