From d3e00decd425982e5b12db5c92f5c902cffdf1af Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 22 Feb 2019 10:48:17 +0100 Subject: Use separate files in phar tests --- ext/phar/tests/phar_begin_setstub_commit.phpt | 24 ++++++++-------- ext/phar/tests/phar_commitwrite.phpt | 16 +++++------ ext/phar/tests/phar_create_in_cwd.phpt | 16 +++++------ ext/phar/tests/phar_setsignaturealgo1.phpt | 4 +-- ext/phar/tests/tar/phar_begin_setstub_commit.phpt | 24 ++++++++-------- ext/phar/tests/tar/phar_commitwrite.phpt | 16 +++++------ ext/phar/tests/zip/phar_begin_setstub_commit.phpt | 34 +++++++++++------------ ext/phar/tests/zip/phar_commitwrite.phpt | 16 +++++------ 8 files changed, 75 insertions(+), 75 deletions(-) (limited to 'ext') diff --git a/ext/phar/tests/phar_begin_setstub_commit.phpt b/ext/phar/tests/phar_begin_setstub_commit.phpt index 029870a45b..ed257f2c52 100644 --- a/ext/phar/tests/phar_begin_setstub_commit.phpt +++ b/ext/phar/tests/phar_begin_setstub_commit.phpt @@ -9,44 +9,44 @@ phar.require_hash=0 phar.readonly=0 --FILE-- getStub()); var_dump($p->isBuffering()); $p->startBuffering(); var_dump($p->isBuffering()); $p['a.php'] = 'setStub(''); -include 'phar://brandnewphar.phar/a.php'; +$p->setStub(''); +include 'phar://phar_begin_setstub_commit.phar/a.php'; var_dump($p->getStub()); $p['b.php'] = 'setStub('setStub('getStub()); $p->stopBuffering(); echo "===COMMIT===\n"; var_dump($p->isBuffering()); -include 'phar://brandnewphar.phar/a.php'; -include 'phar://brandnewphar.phar/b.php'; +include 'phar://phar_begin_setstub_commit.phar/a.php'; +include 'phar://phar_begin_setstub_commit.phar/b.php'; var_dump($p->getStub()); ?> ===DONE=== --CLEAN-- ---EXPECT-- +--EXPECTF-- bool(false) bool(true) string(5) "Hello" -string(84) " +string(%d) " " string(5) "World" -string(85) " +string(%d) " " ===COMMIT=== bool(false) string(5) "Hello" string(5) "World" -string(85) " +string(%d) " " ===DONE=== diff --git a/ext/phar/tests/phar_commitwrite.phpt b/ext/phar/tests/phar_commitwrite.phpt index 8d7068f19a..9671737272 100644 --- a/ext/phar/tests/phar_commitwrite.phpt +++ b/ext/phar/tests/phar_commitwrite.phpt @@ -7,7 +7,7 @@ phar.require_hash=0 phar.readonly=0 --FILE-- stopBuffering(); var_dump(strlen($p->getStub())); @@ -16,8 +16,8 @@ function __autoload(\$class) { include 'phar://' . str_replace('_', '/', \$class); } -Phar::mapPhar('brandnewphar.phar'); -include 'phar://brandnewphar.phar/startup.php'; +Phar::mapPhar('phar_commitwrite.phar'); +include 'phar://phar_commitwrite.phar/startup.php'; __HALT_COMPILER(); ?>"); var_dump($p->getStub()); @@ -25,18 +25,18 @@ var_dump($p->getStub()); ===DONE=== --CLEAN-- ---EXPECT-- +--EXPECTF-- int(6641) -string(200) " " ===DONE=== diff --git a/ext/phar/tests/phar_create_in_cwd.phpt b/ext/phar/tests/phar_create_in_cwd.phpt index 0e0903d1dd..52120fa7f9 100644 --- a/ext/phar/tests/phar_create_in_cwd.phpt +++ b/ext/phar/tests/phar_create_in_cwd.phpt @@ -9,7 +9,7 @@ phar.readonly=0 getStub())); $p->setStub(""); var_dump($p->getStub()); @@ -29,17 +29,17 @@ __HALT_COMPILER(); ===DONE=== --CLEAN-- ---EXPECT-- +--EXPECTF-- int(6641) -string(200) " " ===DONE=== diff --git a/ext/phar/tests/phar_setsignaturealgo1.phpt b/ext/phar/tests/phar_setsignaturealgo1.phpt index a6d59ff470..503a659bce 100644 --- a/ext/phar/tests/phar_setsignaturealgo1.phpt +++ b/ext/phar/tests/phar_setsignaturealgo1.phpt @@ -9,7 +9,7 @@ phar.require_hash=0 phar.readonly=0 --FILE-- getSignature()); $p->setSignatureAlgorithm(Phar::MD5); @@ -38,7 +38,7 @@ echo $e->getMessage(); ===DONE=== --CLEAN-- --EXPECTF-- array(2) { diff --git a/ext/phar/tests/tar/phar_begin_setstub_commit.phpt b/ext/phar/tests/tar/phar_begin_setstub_commit.phpt index d362637cc6..b7e9c708ca 100644 --- a/ext/phar/tests/tar/phar_begin_setstub_commit.phpt +++ b/ext/phar/tests/tar/phar_begin_setstub_commit.phpt @@ -8,46 +8,46 @@ if (!extension_loaded("phar")) die("skip"); phar.readonly=0 --FILE-- isFileFormat(Phar::TAR)); //var_dump($p->getStub()); var_dump($p->isBuffering()); $p->startBuffering(); var_dump($p->isBuffering()); $p['a.php'] = 'setStub(''); -include 'phar://brandnewphar.phar/a.php'; +$p->setStub(''); +include 'phar://phar_begin_setstub_commit.phar/a.php'; var_dump($p->getStub()); $p['b.php'] = 'setStub('setStub('getStub()); $p->stopBuffering(); echo "===COMMIT===\n"; var_dump($p->isBuffering()); -include 'phar://brandnewphar.phar/a.php'; -include 'phar://brandnewphar.phar/b.php'; +include 'phar://phar_begin_setstub_commit.phar/a.php'; +include 'phar://phar_begin_setstub_commit.phar/b.php'; var_dump($p->getStub()); ?> ===DONE=== --CLEAN-- ---EXPECT-- +--EXPECTF-- bool(true) bool(false) bool(true) string(5) "Hello" -string(84) " +string(%d) " " string(5) "World" -string(85) " +string(%d) " " ===COMMIT=== bool(false) string(5) "Hello" string(5) "World" -string(85) " +string(%d) " " ===DONE=== diff --git a/ext/phar/tests/tar/phar_commitwrite.phpt b/ext/phar/tests/tar/phar_commitwrite.phpt index cdfc449c1c..1f6d744917 100644 --- a/ext/phar/tests/tar/phar_commitwrite.phpt +++ b/ext/phar/tests/tar/phar_commitwrite.phpt @@ -7,7 +7,7 @@ phar.require_hash=0 phar.readonly=0 --FILE-- stopBuffering(); var_dump($p->getStub()); @@ -16,8 +16,8 @@ function __autoload(\$class) { include 'phar://' . str_replace('_', '/', \$class); } -Phar::mapPhar('brandnewphar.phar'); -include 'phar://brandnewphar.phar/startup.php'; +Phar::mapPhar('phar_commitwrite.phar'); +include 'phar://phar_commitwrite.phar/startup.php'; __HALT_COMPILER(); ?>"); var_dump($p->getStub()); @@ -26,18 +26,18 @@ var_dump($p->isFileFormat(Phar::TAR)); ===DONE=== --CLEAN-- ---EXPECT-- +--EXPECTF-- string(60) " " bool(true) diff --git a/ext/phar/tests/zip/phar_begin_setstub_commit.phpt b/ext/phar/tests/zip/phar_begin_setstub_commit.phpt index 75122a54a3..b9da14cd75 100644 --- a/ext/phar/tests/zip/phar_begin_setstub_commit.phpt +++ b/ext/phar/tests/zip/phar_begin_setstub_commit.phpt @@ -8,34 +8,34 @@ if (!extension_loaded("phar")) die("skip"); phar.readonly=0 --FILE-- isFileFormat(Phar::ZIP)); //var_dump($p->getStub()); var_dump($p->isBuffering()); $p->startBuffering(); var_dump($p->isBuffering()); $p['a.php'] = 'setStub(''); -include 'phar://brandnewphar.phar/a.php'; +$p->setStub(''); +include 'phar://phar_begin_setstub_commit.phar/a.php'; var_dump($p->getStub()); $p['b.php'] = 'setStub('setStub('getStub()); $p->stopBuffering(); echo "===COMMIT===\n"; var_dump($p->isBuffering()); -include 'phar://brandnewphar.phar/a.php'; -include 'phar://brandnewphar.phar/b.php'; +include 'phar://phar_begin_setstub_commit.phar/a.php'; +include 'phar://phar_begin_setstub_commit.phar/b.php'; var_dump($p->getStub()); // add portion to test setting stub from resource -file_put_contents(dirname(__FILE__) . '/myfakestub.php', ''); +file_put_contents(dirname(__FILE__) . '/myfakestub.php', ''); $a = fopen(dirname(__FILE__) . '/myfakestub.php', 'rb'); $p->setStub($a); var_dump($p->getStub()); -$c = strlen(''); -file_put_contents(dirname(__FILE__) . '/myfakestub.php', '' . 'extra stuff'); +$c = strlen(''); +file_put_contents(dirname(__FILE__) . '/myfakestub.php', '' . 'extra stuff'); fseek($a, 0); $p->setStub($a, $c); var_dump($p->getStub()); @@ -44,27 +44,27 @@ fclose($a); ===DONE=== --CLEAN-- ---EXPECT-- +--EXPECTF-- bool(true) bool(false) bool(true) string(5) "Hello" -string(84) " +string(%d) " " string(5) "World" -string(85) " +string(%d) " " ===COMMIT=== bool(false) string(5) "Hello" string(5) "World" -string(85) " +string(%d) " " -string(93) " +string(%d) " " -string(93) " +string(%d) " " ===DONE=== diff --git a/ext/phar/tests/zip/phar_commitwrite.phpt b/ext/phar/tests/zip/phar_commitwrite.phpt index cb7fa0f35c..fa9efc7bd2 100644 --- a/ext/phar/tests/zip/phar_commitwrite.phpt +++ b/ext/phar/tests/zip/phar_commitwrite.phpt @@ -7,7 +7,7 @@ phar.require_hash=0 phar.readonly=0 --FILE-- stopBuffering(); var_dump($p->getStub()); @@ -16,8 +16,8 @@ function __autoload(\$class) { include 'phar://' . str_replace('_', '/', \$class); } -Phar::mapPhar('brandnewphar.phar'); -include 'phar://brandnewphar.phar/startup.php'; +Phar::mapPhar('phar_commitwrite.phar'); +include 'phar://phar_commitwrite.phar/startup.php'; __HALT_COMPILER(); ?>"); var_dump($p->getStub()); @@ -26,18 +26,18 @@ var_dump($p->isFileFormat(Phar::ZIP)); ===DONE=== --CLEAN-- ---EXPECT-- +--EXPECTF-- string(60) " " bool(true) -- cgit v1.2.1