]> granicus.if.org Git - php/commitdiff
MFB: last test for cached phar copy on write (forgot this one yesterday)
authorGreg Beaver <cellog@php.net>
Tue, 14 Oct 2008 00:38:11 +0000 (00:38 +0000)
committerGreg Beaver <cellog@php.net>
Tue, 14 Oct 2008 00:38:11 +0000 (00:38 +0000)
ext/phar/tests/cache_list/copyonwrite25.phar.phpt [new file with mode: 0644]
ext/phar/tests/cache_list/files/write25.phar [new file with mode: 0644]
ext/phar/tests/cache_list/files/write25.phar.inc [new file with mode: 0644]

diff --git a/ext/phar/tests/cache_list/copyonwrite25.phar.phpt b/ext/phar/tests/cache_list/copyonwrite25.phar.phpt
new file mode 100644 (file)
index 0000000..b661cb6
--- /dev/null
@@ -0,0 +1,16 @@
+--TEST--
+Phar: copy-on-write test 25 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite25.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+<?php if (!extension_loaded("zlib")) die("skip no zlib extension"); ?>
+--FILE_EXTERNAL--
+files/write25.phar
+--EXPECTF--
+bool(false)
+bool(true)
+<?php __HALT_COMPILER();
+ok
\ No newline at end of file
diff --git a/ext/phar/tests/cache_list/files/write25.phar b/ext/phar/tests/cache_list/files/write25.phar
new file mode 100644 (file)
index 0000000..93b301c
Binary files /dev/null and b/ext/phar/tests/cache_list/files/write25.phar differ
diff --git a/ext/phar/tests/cache_list/files/write25.phar.inc b/ext/phar/tests/cache_list/files/write25.phar.inc
new file mode 100644 (file)
index 0000000..60a6978
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write25.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$p = new Phar(__FILE__);
+var_dump(isset($p["mounted"]));
+Phar::mount("mounted", "phar://" . __FILE__ . "/test.txt");
+var_dump(isset($p["mounted"]));
+echo $p["mounted"]->getContent(),"\nok\n";
+__HALT_COMPILER();
+?>');
+$phar['test.txt'] = "<?php __HALT"."_COMPILER();";
+?>