From: Greg Beaver Date: Mon, 13 Oct 2008 04:21:19 +0000 (+0000) Subject: MFB: add complete tests verifying copy-on-write for cached phars X-Git-Tag: BEFORE_HEAD_NS_CHANGE~235 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=072f4489de24c08c680ee5503e90a0590591451d;p=php MFB: add complete tests verifying copy-on-write for cached phars --- diff --git a/ext/phar/tests/cache_list/copyonwrite10.phar.phpt b/ext/phar/tests/cache_list/copyonwrite10.phar.phpt new file mode 100644 index 0000000000..3d5b7fe784 --- /dev/null +++ b/ext/phar/tests/cache_list/copyonwrite10.phar.phpt @@ -0,0 +1,24 @@ +--TEST-- +Phar: copy-on-write test 10 [cache_list] +--INI-- +default_charset=UTF-8 +phar.cache_list={PWD}/copyonwrite10.phar.php +phar.readonly=0 +--SKIPIF-- + +--FILE_EXTERNAL-- +files/write10.phar +--EXPECTF-- +string(214) "getStub()); +$p2 = new Phar(__FILE__); +$a = fopen("phar://" . __FILE__ . "/test.txt", "r"); +$p->setStub($a); +echo $p2->getStub(),"\n"; +echo "ok\n"; +__HALT_COMPILER(); ?> +" + + +ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/copyonwrite11.phar.phpt b/ext/phar/tests/cache_list/copyonwrite11.phar.phpt new file mode 100644 index 0000000000..65388163dc --- /dev/null +++ b/ext/phar/tests/cache_list/copyonwrite11.phar.phpt @@ -0,0 +1,22 @@ +--TEST-- +Phar: copy-on-write test 11 [cache_list] +--INI-- +default_charset=UTF-8 +phar.cache_list={PWD}/copyonwrite11.phar.php +phar.readonly=0 +--SKIPIF-- + +--FILE_EXTERNAL-- +files/write11.phar +--EXPECTF-- +string(174) "getStub()); +$p2 = new Phar(__FILE__); +$p->setDefaultStub(); +echo strlen($p2->getStub()),"\n"; +echo "ok\n"; +__HALT_COMPILER(); ?> +" +6685 +ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/copyonwrite12.phar.phpt b/ext/phar/tests/cache_list/copyonwrite12.phar.phpt new file mode 100644 index 0000000000..40b544191d --- /dev/null +++ b/ext/phar/tests/cache_list/copyonwrite12.phar.phpt @@ -0,0 +1,24 @@ +--TEST-- +Phar: copy-on-write test 12 [cache_list] +--INI-- +default_charset=UTF-8 +phar.cache_list={PWD}/copyonwrite12.phar.php +phar.readonly=0 +--SKIPIF-- + +--FILE_EXTERNAL-- +files/write12.phar +--EXPECTF-- +array(2) { + ["hash"]=> + string(40) "0163F471460EA74F7636268D28289BF5A1E8BD72" + ["hash_type"]=> + string(5) "SHA-1" +} +array(2) { + ["hash"]=> + string(32) "%s" + ["hash_type"]=> + string(3) "MD5" +} +ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/copyonwrite13.phar.phpt b/ext/phar/tests/cache_list/copyonwrite13.phar.phpt new file mode 100644 index 0000000000..fc47174d2b --- /dev/null +++ b/ext/phar/tests/cache_list/copyonwrite13.phar.phpt @@ -0,0 +1,15 @@ +--TEST-- +Phar: copy-on-write test 13 [cache_list] +--INI-- +default_charset=UTF-8 +phar.cache_list={PWD}/copyonwrite13.phar.php +phar.readonly=0 +--SKIPIF-- + + +--FILE_EXTERNAL-- +files/write13.phar +--EXPECTF-- +bool(false) +bool(true) +ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/copyonwrite14.phar.phpt b/ext/phar/tests/cache_list/copyonwrite14.phar.phpt new file mode 100644 index 0000000000..11201ac989 --- /dev/null +++ b/ext/phar/tests/cache_list/copyonwrite14.phar.phpt @@ -0,0 +1,15 @@ +--TEST-- +Phar: copy-on-write test 14 [cache_list] +--INI-- +default_charset=UTF-8 +phar.cache_list={PWD}/copyonwrite14.phar.php +phar.readonly=0 +--SKIPIF-- + + +--FILE_EXTERNAL-- +files/write14.phar +--EXPECTF-- +bool(true) +bool(false) +ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/copyonwrite15.phar.phpt b/ext/phar/tests/cache_list/copyonwrite15.phar.phpt new file mode 100644 index 0000000000..6e46289227 --- /dev/null +++ b/ext/phar/tests/cache_list/copyonwrite15.phar.phpt @@ -0,0 +1,14 @@ +--TEST-- +Phar: copy-on-write test 15 [cache_list] +--INI-- +default_charset=UTF-8 +phar.cache_list={PWD}/copyonwrite15.phar.php +phar.readonly=0 +--SKIPIF-- + +--FILE_EXTERNAL-- +files/write15.phar +--EXPECTF-- +bool(false) +bool(true) +ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/copyonwrite16.phar.phpt b/ext/phar/tests/cache_list/copyonwrite16.phar.phpt new file mode 100644 index 0000000000..f17784c355 --- /dev/null +++ b/ext/phar/tests/cache_list/copyonwrite16.phar.phpt @@ -0,0 +1,14 @@ +--TEST-- +Phar: copy-on-write test 16 [cache_list] +--INI-- +default_charset=UTF-8 +phar.cache_list={PWD}/copyonwrite16.phar.php +phar.readonly=0 +--SKIPIF-- + +--FILE_EXTERNAL-- +files/write16.phar +--EXPECTF-- +bool(true) +bool(false) +ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/copyonwrite17.phar.phpt b/ext/phar/tests/cache_list/copyonwrite17.phar.phpt new file mode 100644 index 0000000000..6e13088512 --- /dev/null +++ b/ext/phar/tests/cache_list/copyonwrite17.phar.phpt @@ -0,0 +1,14 @@ +--TEST-- +Phar: copy-on-write test 17 [cache_list] +--INI-- +default_charset=UTF-8 +phar.cache_list={PWD}/copyonwrite17.phar.php +phar.readonly=0 +--SKIPIF-- + +--FILE_EXTERNAL-- +files/write17.phar +--EXPECTF-- +NULL +string(2) "hi" +ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/copyonwrite18.phar.phpt b/ext/phar/tests/cache_list/copyonwrite18.phar.phpt new file mode 100644 index 0000000000..3e65f5a124 --- /dev/null +++ b/ext/phar/tests/cache_list/copyonwrite18.phar.phpt @@ -0,0 +1,14 @@ +--TEST-- +Phar: copy-on-write test 18 [cache_list] +--INI-- +default_charset=UTF-8 +phar.cache_list={PWD}/copyonwrite18.phar.php +phar.readonly=0 +--SKIPIF-- + +--FILE_EXTERNAL-- +files/write18.phar +--EXPECTF-- +100666 +100444 +ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/copyonwrite19.phar.phpt b/ext/phar/tests/cache_list/copyonwrite19.phar.phpt new file mode 100644 index 0000000000..4870550c4d --- /dev/null +++ b/ext/phar/tests/cache_list/copyonwrite19.phar.phpt @@ -0,0 +1,14 @@ +--TEST-- +Phar: copy-on-write test 19 [cache_list] +--INI-- +default_charset=UTF-8 +phar.cache_list={PWD}/copyonwrite19.phar.php +phar.readonly=0 +--SKIPIF-- + +--FILE_EXTERNAL-- +files/write19.phar +--EXPECTF-- +string(2) "hi" +string(3) "hi2" +ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/copyonwrite20.phar.phpt b/ext/phar/tests/cache_list/copyonwrite20.phar.phpt new file mode 100644 index 0000000000..acce57415c --- /dev/null +++ b/ext/phar/tests/cache_list/copyonwrite20.phar.phpt @@ -0,0 +1,14 @@ +--TEST-- +Phar: copy-on-write test 20 [cache_list] +--INI-- +default_charset=UTF-8 +phar.cache_list={PWD}/copyonwrite20.phar.php +phar.readonly=0 +--SKIPIF-- + +--FILE_EXTERNAL-- +files/write20.phar +--EXPECTF-- +string(2) "hi" +NULL +ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/copyonwrite21.phar.phpt b/ext/phar/tests/cache_list/copyonwrite21.phar.phpt new file mode 100644 index 0000000000..8960ea7171 --- /dev/null +++ b/ext/phar/tests/cache_list/copyonwrite21.phar.phpt @@ -0,0 +1,15 @@ +--TEST-- +Phar: copy-on-write test 21 [cache_list] +--INI-- +default_charset=UTF-8 +phar.cache_list={PWD}/copyonwrite21.phar.php +phar.readonly=0 +--SKIPIF-- + + +--FILE_EXTERNAL-- +files/write21.phar +--EXPECTF-- +bool(false) +bool(true) +ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/copyonwrite22.phar.phpt b/ext/phar/tests/cache_list/copyonwrite22.phar.phpt new file mode 100644 index 0000000000..7cba216395 --- /dev/null +++ b/ext/phar/tests/cache_list/copyonwrite22.phar.phpt @@ -0,0 +1,15 @@ +--TEST-- +Phar: copy-on-write test 22 [cache_list] +--INI-- +default_charset=UTF-8 +phar.cache_list={PWD}/copyonwrite22.phar.php +phar.readonly=0 +--SKIPIF-- + + +--FILE_EXTERNAL-- +files/write22.phar +--EXPECTF-- +bool(true) +bool(false) +ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/copyonwrite23.phar.phpt b/ext/phar/tests/cache_list/copyonwrite23.phar.phpt new file mode 100644 index 0000000000..292e5af668 --- /dev/null +++ b/ext/phar/tests/cache_list/copyonwrite23.phar.phpt @@ -0,0 +1,17 @@ +--TEST-- +Phar: copy-on-write test 23 [cache_list] +--INI-- +default_charset=UTF-8 +phar.cache_list={PWD}/copyonwrite23.phar.php +phar.readonly=0 +--SKIPIF-- + + +--FILE_EXTERNAL-- +files/write23.phar +--EXPECTF-- +bool(true) +bool(false) +bool(false) +bool(true) +ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/copyonwrite24.phar.phpt b/ext/phar/tests/cache_list/copyonwrite24.phar.phpt new file mode 100644 index 0000000000..69197f2b4b --- /dev/null +++ b/ext/phar/tests/cache_list/copyonwrite24.phar.phpt @@ -0,0 +1,15 @@ +--TEST-- +Phar: copy-on-write test 24 [cache_list] +--INI-- +default_charset=UTF-8 +phar.cache_list={PWD}/copyonwrite24.phar.php +phar.readonly=0 +--SKIPIF-- + + +--FILE_EXTERNAL-- +files/write24.phar +--EXPECTF-- +bool(false) +bool(true) +ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/copyonwrite4.phar.phpt b/ext/phar/tests/cache_list/copyonwrite4.phar.phpt new file mode 100644 index 0000000000..20ff78e282 --- /dev/null +++ b/ext/phar/tests/cache_list/copyonwrite4.phar.phpt @@ -0,0 +1,15 @@ +--TEST-- +Phar: copy-on-write test 4 [cache_list] +--INI-- +default_charset=UTF-8 +phar.cache_list={PWD}/copyonwrite4.phar.php +phar.readonly=0 +--SKIPIF-- + +--FILE_EXTERNAL-- +files/write4.phar +--EXPECT-- +bool(false) +bool(true) +string(2) "hi" +ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/copyonwrite4a.phpt b/ext/phar/tests/cache_list/copyonwrite4a.phpt new file mode 100644 index 0000000000..1945e31f16 --- /dev/null +++ b/ext/phar/tests/cache_list/copyonwrite4a.phpt @@ -0,0 +1,20 @@ +--TEST-- +Phar: copy-on-write test 4a [cache_list] +--INI-- +default_charset=UTF-8 +phar.cache_list={PWD}/copyonwrite4.phar.php +phar.readonly=0 +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +bool(false) +bool(true) +string(2) "hi" +===DONE=== \ No newline at end of file diff --git a/ext/phar/tests/cache_list/copyonwrite5.phar.phpt b/ext/phar/tests/cache_list/copyonwrite5.phar.phpt new file mode 100644 index 0000000000..89990a7af1 --- /dev/null +++ b/ext/phar/tests/cache_list/copyonwrite5.phar.phpt @@ -0,0 +1,27 @@ +--TEST-- +Phar: copy-on-write test 5 [cache_list] +--INI-- +default_charset=UTF-8 +phar.cache_list={PWD}/copyonwrite5.phar.php +phar.readonly=0 +--SKIPIF-- + +--FILE_EXTERNAL-- +files/write5.phar +--CLEAN-- + +--EXPECTF-- +array(2) { + ["file1"]=> + string(%d) "%sfile1" + ["file2"]=> + string(%d) "%sfile2" +} +phar://%scopyonwrite5.phar.php%cfile1 file1 +phar://%scopyonwrite5.phar.php%cfile2 file2 +phar://%scopyonwrite5.phar.php%chi hi +ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/copyonwrite6.phar.phpt b/ext/phar/tests/cache_list/copyonwrite6.phar.phpt new file mode 100644 index 0000000000..083a14178b --- /dev/null +++ b/ext/phar/tests/cache_list/copyonwrite6.phar.phpt @@ -0,0 +1,27 @@ +--TEST-- +Phar: copy-on-write test 6 [cache_list] +--INI-- +default_charset=UTF-8 +phar.cache_list={PWD}/copyonwrite6.phar.php +phar.readonly=0 +--SKIPIF-- + +--FILE_EXTERNAL-- +files/write6.phar +--CLEAN-- + +--EXPECTF-- +array(2) { + ["file1"]=> + string(%d) "%sfile1" + ["file2"]=> + string(%d) "%sfile2" +} +phar://%scopyonwrite6.phar.php%cfile1 file1 +phar://%scopyonwrite6.phar.php%cfile2 file2 +phar://%scopyonwrite6.phar.php%chi hi +ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/copyonwrite7.phar.phpt b/ext/phar/tests/cache_list/copyonwrite7.phar.phpt new file mode 100644 index 0000000000..d6faded9cc --- /dev/null +++ b/ext/phar/tests/cache_list/copyonwrite7.phar.phpt @@ -0,0 +1,14 @@ +--TEST-- +Phar: copy-on-write test 7 [cache_list] +--INI-- +default_charset=UTF-8 +phar.cache_list={PWD}/copyonwrite7.phar.php +phar.readonly=0 +--SKIPIF-- + +--FILE_EXTERNAL-- +files/write7.phar +--EXPECT-- +bool(true) +bool(false) +ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/copyonwrite8.phar.phpt b/ext/phar/tests/cache_list/copyonwrite8.phar.phpt new file mode 100644 index 0000000000..7217d336e2 --- /dev/null +++ b/ext/phar/tests/cache_list/copyonwrite8.phar.phpt @@ -0,0 +1,14 @@ +--TEST-- +Phar: copy-on-write test 8 [cache_list] +--INI-- +default_charset=UTF-8 +phar.cache_list={PWD}/copyonwrite8.phar.php +phar.readonly=0 +--SKIPIF-- + +--FILE_EXTERNAL-- +files/write8.phar +--EXPECTF-- +string(%s) "%scopyonwrite8.phar.php" +hi +ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/copyonwrite9.phar.phpt b/ext/phar/tests/cache_list/copyonwrite9.phar.phpt new file mode 100644 index 0000000000..ffda9565bd --- /dev/null +++ b/ext/phar/tests/cache_list/copyonwrite9.phar.phpt @@ -0,0 +1,23 @@ +--TEST-- +Phar: copy-on-write test 9 [cache_list] +--INI-- +default_charset=UTF-8 +phar.cache_list={PWD}/copyonwrite9.phar.php +phar.readonly=0 +--SKIPIF-- + +--FILE_EXTERNAL-- +files/write9.phar +--EXPECTF-- +string(188) "getStub()); +$p2 = new Phar(__FILE__); +$p->setStub("getStub(),"\n"; +echo "ok\n"; +__HALT_COMPILER(); ?> +" + + +ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/files/write10.phar b/ext/phar/tests/cache_list/files/write10.phar new file mode 100644 index 0000000000..473f0a17ab Binary files /dev/null and b/ext/phar/tests/cache_list/files/write10.phar differ diff --git a/ext/phar/tests/cache_list/files/write10.phar.inc b/ext/phar/tests/cache_list/files/write10.phar.inc new file mode 100644 index 0000000000..a23b5e5ebc --- /dev/null +++ b/ext/phar/tests/cache_list/files/write10.phar.inc @@ -0,0 +1,18 @@ +setStub('getStub()); +$p2 = new Phar(__FILE__); +$a = fopen("phar://" . __FILE__ . "/test.txt", "r"); +$p->setStub($a); +echo $p2->getStub(),"\n"; +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['test.txt'] = " diff --git a/ext/phar/tests/cache_list/files/write11.phar b/ext/phar/tests/cache_list/files/write11.phar new file mode 100644 index 0000000000..bb8d33f2ac Binary files /dev/null and b/ext/phar/tests/cache_list/files/write11.phar differ diff --git a/ext/phar/tests/cache_list/files/write11.phar.inc b/ext/phar/tests/cache_list/files/write11.phar.inc new file mode 100644 index 0000000000..d2552642b4 --- /dev/null +++ b/ext/phar/tests/cache_list/files/write11.phar.inc @@ -0,0 +1,17 @@ +setStub('getStub()); +$p2 = new Phar(__FILE__); +$p->setDefaultStub(); +echo strlen($p2->getStub()),"\n"; +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['test.txt'] = " diff --git a/ext/phar/tests/cache_list/files/write12.phar b/ext/phar/tests/cache_list/files/write12.phar new file mode 100644 index 0000000000..bff1456273 Binary files /dev/null and b/ext/phar/tests/cache_list/files/write12.phar differ diff --git a/ext/phar/tests/cache_list/files/write12.phar.inc b/ext/phar/tests/cache_list/files/write12.phar.inc new file mode 100644 index 0000000000..f0c01eb28a --- /dev/null +++ b/ext/phar/tests/cache_list/files/write12.phar.inc @@ -0,0 +1,17 @@ +setStub('getSignature()); +$p2 = new Phar(__FILE__); +$p->setSignatureAlgorithm(Phar::MD5); +var_dump($p->getSignature()); +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['test.txt'] = " diff --git a/ext/phar/tests/cache_list/files/write13.phar b/ext/phar/tests/cache_list/files/write13.phar new file mode 100644 index 0000000000..46ca14df1a Binary files /dev/null and b/ext/phar/tests/cache_list/files/write13.phar differ diff --git a/ext/phar/tests/cache_list/files/write13.phar.inc b/ext/phar/tests/cache_list/files/write13.phar.inc new file mode 100644 index 0000000000..e8b6f33f37 --- /dev/null +++ b/ext/phar/tests/cache_list/files/write13.phar.inc @@ -0,0 +1,17 @@ +setStub('isCompressed()); +$p2 = new Phar(__FILE__); +$p->compressFiles(Phar::GZ); +var_dump($p["test.txt"]->isCompressed()); +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['test.txt'] = " diff --git a/ext/phar/tests/cache_list/files/write14.phar b/ext/phar/tests/cache_list/files/write14.phar new file mode 100644 index 0000000000..4482752567 Binary files /dev/null and b/ext/phar/tests/cache_list/files/write14.phar differ diff --git a/ext/phar/tests/cache_list/files/write14.phar.inc b/ext/phar/tests/cache_list/files/write14.phar.inc new file mode 100644 index 0000000000..c2b0448657 --- /dev/null +++ b/ext/phar/tests/cache_list/files/write14.phar.inc @@ -0,0 +1,18 @@ +setStub('isCompressed()); +$p2 = new Phar(__FILE__); +$p->decompressFiles(); +var_dump($p["test.txt"]->isCompressed()); +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['test.txt'] = "compressFiles(Phar::GZ); +?> diff --git a/ext/phar/tests/cache_list/files/write15.phar b/ext/phar/tests/cache_list/files/write15.phar new file mode 100644 index 0000000000..c6190b7315 Binary files /dev/null and b/ext/phar/tests/cache_list/files/write15.phar differ diff --git a/ext/phar/tests/cache_list/files/write15.phar.inc b/ext/phar/tests/cache_list/files/write15.phar.inc new file mode 100644 index 0000000000..d30f6c88ae --- /dev/null +++ b/ext/phar/tests/cache_list/files/write15.phar.inc @@ -0,0 +1,16 @@ +setStub('copy("test.txt","copied"); +var_dump(isset($p["copied"])); +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['test.txt'] = " diff --git a/ext/phar/tests/cache_list/files/write16.phar b/ext/phar/tests/cache_list/files/write16.phar new file mode 100644 index 0000000000..05106ea9ef Binary files /dev/null and b/ext/phar/tests/cache_list/files/write16.phar differ diff --git a/ext/phar/tests/cache_list/files/write16.phar.inc b/ext/phar/tests/cache_list/files/write16.phar.inc new file mode 100644 index 0000000000..b7a1b386af --- /dev/null +++ b/ext/phar/tests/cache_list/files/write16.phar.inc @@ -0,0 +1,17 @@ +setStub(''); +$phar['test.txt'] = " diff --git a/ext/phar/tests/cache_list/files/write17.phar b/ext/phar/tests/cache_list/files/write17.phar new file mode 100644 index 0000000000..52ddb5e0e1 Binary files /dev/null and b/ext/phar/tests/cache_list/files/write17.phar differ diff --git a/ext/phar/tests/cache_list/files/write17.phar.inc b/ext/phar/tests/cache_list/files/write17.phar.inc new file mode 100644 index 0000000000..47f5ea3c69 --- /dev/null +++ b/ext/phar/tests/cache_list/files/write17.phar.inc @@ -0,0 +1,16 @@ +setStub('getMetadata()); +$p->setMetadata("hi"); +var_dump($p->getMetadata()); +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['test.txt'] = " diff --git a/ext/phar/tests/cache_list/files/write18.phar b/ext/phar/tests/cache_list/files/write18.phar new file mode 100644 index 0000000000..3fc9fe1401 Binary files /dev/null and b/ext/phar/tests/cache_list/files/write18.phar differ diff --git a/ext/phar/tests/cache_list/files/write18.phar.inc b/ext/phar/tests/cache_list/files/write18.phar.inc new file mode 100644 index 0000000000..fca867d551 --- /dev/null +++ b/ext/phar/tests/cache_list/files/write18.phar.inc @@ -0,0 +1,17 @@ +setStub('chmod(0444); +echo decoct(fileperms("phar://" . __FILE__ . "/test.txt")),"\n"; +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['test.txt'] = "chmod(0666); +?> diff --git a/ext/phar/tests/cache_list/files/write19.phar b/ext/phar/tests/cache_list/files/write19.phar new file mode 100644 index 0000000000..9e8b7eec8b Binary files /dev/null and b/ext/phar/tests/cache_list/files/write19.phar differ diff --git a/ext/phar/tests/cache_list/files/write19.phar.inc b/ext/phar/tests/cache_list/files/write19.phar.inc new file mode 100644 index 0000000000..55115ad713 --- /dev/null +++ b/ext/phar/tests/cache_list/files/write19.phar.inc @@ -0,0 +1,17 @@ +setStub('getMetadata()); +$p["test.txt"]->setMetadata("hi2"); +var_dump($p["test.txt"]->getMetadata()); +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['test.txt'] = "setMetadata("hi"); +?> diff --git a/ext/phar/tests/cache_list/files/write2.phar.inc b/ext/phar/tests/cache_list/files/write2.phar.inc new file mode 100644 index 0000000000..7a4e2e39f8 --- /dev/null +++ b/ext/phar/tests/cache_list/files/write2.phar.inc @@ -0,0 +1,23 @@ +setStub('getMetadata()); +mkdir("phar://" . __FILE__ . "/test"); +var_dump(is_dir("phar://" . __FILE__ . "/test")); +$phar2 = new Phar(__FILE__); +var_dump($phar2->getMetadata()); +var_dump(isset($phar["test"])); +var_dump(isset($phar2["test"])); +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar->setMetadata('hi'); +$phar['test.txt'] = "hi +"; +$phar['test.txt']->setMetadata('hi'); +?> diff --git a/ext/phar/tests/cache_list/files/write20.phar b/ext/phar/tests/cache_list/files/write20.phar new file mode 100644 index 0000000000..61092645b6 Binary files /dev/null and b/ext/phar/tests/cache_list/files/write20.phar differ diff --git a/ext/phar/tests/cache_list/files/write20.phar.inc b/ext/phar/tests/cache_list/files/write20.phar.inc new file mode 100644 index 0000000000..d356bfbb44 --- /dev/null +++ b/ext/phar/tests/cache_list/files/write20.phar.inc @@ -0,0 +1,17 @@ +setStub('getMetadata()); +$p["test.txt"]->delMetadata(); +var_dump($p["test.txt"]->getMetadata()); +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['test.txt'] = "setMetadata("hi"); +?> diff --git a/ext/phar/tests/cache_list/files/write21.phar b/ext/phar/tests/cache_list/files/write21.phar new file mode 100644 index 0000000000..fad2165daa Binary files /dev/null and b/ext/phar/tests/cache_list/files/write21.phar differ diff --git a/ext/phar/tests/cache_list/files/write21.phar.inc b/ext/phar/tests/cache_list/files/write21.phar.inc new file mode 100644 index 0000000000..79bfb20067 --- /dev/null +++ b/ext/phar/tests/cache_list/files/write21.phar.inc @@ -0,0 +1,16 @@ +setStub('isCompressed()); +$p["test.txt"]->compress(Phar::GZ); +var_dump($p["test.txt"]->isCompressed()); +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['test.txt'] = " diff --git a/ext/phar/tests/cache_list/files/write22.phar b/ext/phar/tests/cache_list/files/write22.phar new file mode 100644 index 0000000000..c3c5ce1e29 Binary files /dev/null and b/ext/phar/tests/cache_list/files/write22.phar differ diff --git a/ext/phar/tests/cache_list/files/write22.phar.inc b/ext/phar/tests/cache_list/files/write22.phar.inc new file mode 100644 index 0000000000..861cabbc6c --- /dev/null +++ b/ext/phar/tests/cache_list/files/write22.phar.inc @@ -0,0 +1,17 @@ +setStub('isCompressed()); +$p["test.txt"]->decompress(); +var_dump($p["test.txt"]->isCompressed()); +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['test.txt'] = "compress(Phar::GZ); +?> diff --git a/ext/phar/tests/cache_list/files/write23.phar b/ext/phar/tests/cache_list/files/write23.phar new file mode 100644 index 0000000000..2246f61c0c Binary files /dev/null and b/ext/phar/tests/cache_list/files/write23.phar differ diff --git a/ext/phar/tests/cache_list/files/write23.phar.inc b/ext/phar/tests/cache_list/files/write23.phar.inc new file mode 100644 index 0000000000..ac92a85eea --- /dev/null +++ b/ext/phar/tests/cache_list/files/write23.phar.inc @@ -0,0 +1,16 @@ +setStub(''); +$phar['test.txt'] = " diff --git a/ext/phar/tests/cache_list/files/write24.phar b/ext/phar/tests/cache_list/files/write24.phar new file mode 100644 index 0000000000..d726ceef76 Binary files /dev/null and b/ext/phar/tests/cache_list/files/write24.phar differ diff --git a/ext/phar/tests/cache_list/files/write24.phar.inc b/ext/phar/tests/cache_list/files/write24.phar.inc new file mode 100644 index 0000000000..ac96731960 --- /dev/null +++ b/ext/phar/tests/cache_list/files/write24.phar.inc @@ -0,0 +1,18 @@ +setStub(''); +$phar['test.txt'] = " diff --git a/ext/phar/tests/cache_list/files/write3.phar b/ext/phar/tests/cache_list/files/write3.phar index c5be7daceb..5ce4a95f79 100644 Binary files a/ext/phar/tests/cache_list/files/write3.phar and b/ext/phar/tests/cache_list/files/write3.phar differ diff --git a/ext/phar/tests/cache_list/files/write3.phar.inc b/ext/phar/tests/cache_list/files/write3.phar.inc new file mode 100644 index 0000000000..686c065bde --- /dev/null +++ b/ext/phar/tests/cache_list/files/write3.phar.inc @@ -0,0 +1,21 @@ +setStub(''); +$phar->setMetadata('hi'); +$phar['test.txt'] = "hi +"; +$phar['test.txt']->setMetadata('hi'); +$phar->addEmptyDir('test'); +?> diff --git a/ext/phar/tests/cache_list/files/write4.phar b/ext/phar/tests/cache_list/files/write4.phar new file mode 100644 index 0000000000..c267babb42 Binary files /dev/null and b/ext/phar/tests/cache_list/files/write4.phar differ diff --git a/ext/phar/tests/cache_list/files/write4.phar.inc b/ext/phar/tests/cache_list/files/write4.phar.inc new file mode 100644 index 0000000000..5b476ed0a3 --- /dev/null +++ b/ext/phar/tests/cache_list/files/write4.phar.inc @@ -0,0 +1,16 @@ +setStub(''); +$phar['tobemounted'] = "hi"; +?> diff --git a/ext/phar/tests/cache_list/files/write5.phar b/ext/phar/tests/cache_list/files/write5.phar new file mode 100644 index 0000000000..b3a318b5a2 Binary files /dev/null and b/ext/phar/tests/cache_list/files/write5.phar differ diff --git a/ext/phar/tests/cache_list/files/write5.phar.inc b/ext/phar/tests/cache_list/files/write5.phar.inc new file mode 100644 index 0000000000..04a4dfe18d --- /dev/null +++ b/ext/phar/tests/cache_list/files/write5.phar.inc @@ -0,0 +1,27 @@ +setStub('buildFromDirectory($d)); +$phar2 = new Phar(__FILE__); +$arr = array(); +foreach ($phar2 as $name => $file) { + $arr[$name] = $file->getContent(); +} +asort($arr); +foreach ($arr as $name => $content) { + echo $name, " ", $content; +} +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['hi'] = "hi\n"; +?> diff --git a/ext/phar/tests/cache_list/files/write6.phar b/ext/phar/tests/cache_list/files/write6.phar new file mode 100644 index 0000000000..68a4a8674d Binary files /dev/null and b/ext/phar/tests/cache_list/files/write6.phar differ diff --git a/ext/phar/tests/cache_list/files/write6.phar.inc b/ext/phar/tests/cache_list/files/write6.phar.inc new file mode 100644 index 0000000000..4010b60779 --- /dev/null +++ b/ext/phar/tests/cache_list/files/write6.phar.inc @@ -0,0 +1,27 @@ +setStub('buildFromIterator(new RecursiveDirectoryIterator($d),$d)); +$phar2 = new Phar(__FILE__); +$arr = array(); +foreach ($phar2 as $name => $file) { + $arr[$name] = $file->getContent(); +} +asort($arr); +foreach ($arr as $name => $content) { + echo $name, " ", $content; +} +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['hi'] = "hi\n"; +?> diff --git a/ext/phar/tests/cache_list/files/write7.phar b/ext/phar/tests/cache_list/files/write7.phar new file mode 100644 index 0000000000..e5854ec057 Binary files /dev/null and b/ext/phar/tests/cache_list/files/write7.phar differ diff --git a/ext/phar/tests/cache_list/files/write7.phar.inc b/ext/phar/tests/cache_list/files/write7.phar.inc new file mode 100644 index 0000000000..ef5b8b2dd0 --- /dev/null +++ b/ext/phar/tests/cache_list/files/write7.phar.inc @@ -0,0 +1,18 @@ +setStub('delete("test.txt"); +clearstatcache(); +var_dump(file_exists("phar://" . __FILE__ . "/test.txt")); +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['test.txt'] = "hi +"; +?> diff --git a/ext/phar/tests/cache_list/files/write8.phar b/ext/phar/tests/cache_list/files/write8.phar new file mode 100644 index 0000000000..d5d63be132 Binary files /dev/null and b/ext/phar/tests/cache_list/files/write8.phar differ diff --git a/ext/phar/tests/cache_list/files/write8.phar.inc b/ext/phar/tests/cache_list/files/write8.phar.inc new file mode 100644 index 0000000000..2b733a765f --- /dev/null +++ b/ext/phar/tests/cache_list/files/write8.phar.inc @@ -0,0 +1,18 @@ +setStub('getAlias()); +$p2 = new Phar(__FILE__); +$p->setAlias("hi"); +echo $p2->getAlias(),"\n"; +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['test.txt'] = "hi +"; +?> diff --git a/ext/phar/tests/cache_list/files/write9.phar b/ext/phar/tests/cache_list/files/write9.phar new file mode 100644 index 0000000000..c012c177ce Binary files /dev/null and b/ext/phar/tests/cache_list/files/write9.phar differ diff --git a/ext/phar/tests/cache_list/files/write9.phar.inc b/ext/phar/tests/cache_list/files/write9.phar.inc new file mode 100644 index 0000000000..ed3e681c22 --- /dev/null +++ b/ext/phar/tests/cache_list/files/write9.phar.inc @@ -0,0 +1,18 @@ +setStub('getStub()); +$p2 = new Phar(__FILE__); +$p->setStub("getStub(),"\n"; +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['test.txt'] = "hi +"; +?>