summaryrefslogtreecommitdiff
path: root/ext/phar/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ext/phar/tests')
-rw-r--r--ext/phar/tests/files/blog.pharbin496 -> 468 bytes
-rw-r--r--ext/phar/tests/files/blog.phar.inc4
-rw-r--r--ext/phar/tests/phar_get_supported_signatures_002a.phpt1
-rwxr-xr-xext/phar/tests/phar_oo_005.phpt3
-rw-r--r--ext/phar/tests/phar_setsignaturealgo2.phpt4
-rw-r--r--ext/phar/tests/stat.phpt14
-rw-r--r--ext/phar/tests/tar/phar_setsignaturealgo2.phpt6
-rw-r--r--ext/phar/tests/tar/rmdir.phpt3
-rw-r--r--ext/phar/tests/test_signaturealgos.phpt1
-rw-r--r--ext/phar/tests/zip/bzip2.phpt3
-rw-r--r--ext/phar/tests/zip/rmdir.phpt3
11 files changed, 9 insertions, 33 deletions
diff --git a/ext/phar/tests/files/blog.phar b/ext/phar/tests/files/blog.phar
index 9f0425db84..58c8a3bca7 100644
--- a/ext/phar/tests/files/blog.phar
+++ b/ext/phar/tests/files/blog.phar
Binary files differ
diff --git a/ext/phar/tests/files/blog.phar.inc b/ext/phar/tests/files/blog.phar.inc
index 0f2afe475d..62d86c5c3f 100644
--- a/ext/phar/tests/files/blog.phar.inc
+++ b/ext/phar/tests/files/blog.phar.inc
@@ -4,9 +4,7 @@ $fname = dirname(__FILE__) . '/blog.phar';
@unlink($fname);
$phar = new Phar($fname);
-$phar->setStub('<?php
-Phar::interceptFileFuncs();
-if(file_exists(dirname(__FILE__) . "/files/config.xml")) {
+$phar->setStub('<?php if(file_exists(dirname(__FILE__) . "/files/config.xml")) {
Phar::mount("config.xml", dirname(__FILE__) . "/files/config.xml");
}
Phar::webPhar("blog", "index.php");
diff --git a/ext/phar/tests/phar_get_supported_signatures_002a.phpt b/ext/phar/tests/phar_get_supported_signatures_002a.phpt
index 154d1806c6..ce907ff638 100644
--- a/ext/phar/tests/phar_get_supported_signatures_002a.phpt
+++ b/ext/phar/tests/phar_get_supported_signatures_002a.phpt
@@ -6,7 +6,6 @@ if (!extension_loaded("phar")) die("skip");
if (!extension_loaded("hash")) die("skip extension hash required");
$arr = Phar::getSupportedSignatures();
if (!in_array("OpenSSL", $arr)) die("skip openssl support required");
-if (!in_array('SHA-256', $arr)) die("skip hash extension loaded shared");
?>
--INI--
phar.require_hash=0
diff --git a/ext/phar/tests/phar_oo_005.phpt b/ext/phar/tests/phar_oo_005.phpt
index 2d4cbd082c..119e013699 100755
--- a/ext/phar/tests/phar_oo_005.phpt
+++ b/ext/phar/tests/phar_oo_005.phpt
@@ -4,8 +4,7 @@ Phar and RecursiveDirectoryIterator
<?php
if (!extension_loaded("phar")) die("skip");
if (!extension_loaded("spl")) die("skip SPL not available");
-if (version_compare(PHP_VERSION, "5.3", "<") or version_compare(PHP_VERSION, "5.4", ">="))
- die("skip requires 5.3");
+if (!version_compare(PHP_VERSION, "5.3", "==")) die("skip requires 5.3");
?>
--INI--
phar.require_hash=0
diff --git a/ext/phar/tests/phar_setsignaturealgo2.phpt b/ext/phar/tests/phar_setsignaturealgo2.phpt
index 66edb61222..e3f858d5d6 100644
--- a/ext/phar/tests/phar_setsignaturealgo2.phpt
+++ b/ext/phar/tests/phar_setsignaturealgo2.phpt
@@ -4,9 +4,7 @@ Phar::setSupportedSignatures() with hash
<?php
if (!extension_loaded("phar")) die("skip");
if (!extension_loaded("hash")) die("skip hash extension required");
-$arr = Phar::getSupportedSignatures();
-if (!in_array("OpenSSL", $arr)) die("skip openssl support required");
-if (!in_array('SHA-256', $arr)) die("skip hash extension loaded shared");
+if (!extension_loaded("openssl")) die("skip openssl extension required");
?>
--INI--
phar.require_hash=0
diff --git a/ext/phar/tests/stat.phpt b/ext/phar/tests/stat.phpt
index 184aa6d2ec..020fc24f86 100644
--- a/ext/phar/tests/stat.phpt
+++ b/ext/phar/tests/stat.phpt
@@ -14,7 +14,7 @@ $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
$fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.tar';
$fname3 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.tar';
$a = new Phar($fname);
-$a['my/index.php'] = '<?php
+$a['index.php'] = '<?php
echo "stat\n";
var_dump(stat("dir/file1.txt"));
echo "lstat\n";
@@ -53,17 +53,13 @@ echo "is_file\n";
var_dump(is_file("dir/file1.txt"));
echo "is_link\n";
var_dump(is_link("dir/file1.txt"));
-echo "not found\n";
-var_dump(file_exists("not/found"));
-echo "not found 2\n";
-var_dump(fileperms("not/found"));
?>';
$a['dir/file1.txt'] = 'hi';
$a['dir/file2.txt'] = 'hi2';
$a['dir/file3.txt'] = 'hi3';
$a->setStub('<?php
set_include_path("phar://" . __FILE__ . "/dir" . PATH_SEPARATOR . "phar://" . __FILE__);
-include "my/index.php";
+include "index.php";
__HALT_COMPILER();');
include $fname;
?>
@@ -216,10 +212,4 @@ is_file
bool(true)
is_link
bool(false)
-not found
-bool(false)
-not found 2
-
-Warning: fileperms(): stat failed for not/found in phar://%sstat.phar.php/my/index.php on line %d
-bool(false)
===DONE=== \ No newline at end of file
diff --git a/ext/phar/tests/tar/phar_setsignaturealgo2.phpt b/ext/phar/tests/tar/phar_setsignaturealgo2.phpt
index 422ca90e8a..e9cbdb4a5d 100644
--- a/ext/phar/tests/tar/phar_setsignaturealgo2.phpt
+++ b/ext/phar/tests/tar/phar_setsignaturealgo2.phpt
@@ -2,10 +2,8 @@
Phar::setSupportedSignatures() with hash, tar-based
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
-<?php if (!extension_loaded("hash")) die("skip extension hash required");
-$arr = Phar::getSupportedSignatures();
-if (!in_array("OpenSSL", $arr)) die("skip openssl support required");
-if (!in_array('SHA-256', $arr)) die("skip hash extension loaded shared"); ?>
+<?php if (!extension_loaded("hash")) die("skip extension hash required"); ?>
+<?php if (!extension_loaded("openssl")) die("skip extension openssl required"); ?>
--INI--
phar.require_hash=0
phar.readonly=0
diff --git a/ext/phar/tests/tar/rmdir.phpt b/ext/phar/tests/tar/rmdir.phpt
index be037823d6..d08e521614 100644
--- a/ext/phar/tests/tar/rmdir.phpt
+++ b/ext/phar/tests/tar/rmdir.phpt
@@ -23,7 +23,6 @@ $files['a/x'] = 'a';
foreach ($files as $n => $file) {
$tar->addFile($n, $file);
}
-$tar->mkdir('a');
$tar->close();
@@ -40,7 +39,7 @@ var_dump(rmdir($alias . '/a'));
--EXPECTF--
a
-Warning: rmdir(): phar error: Directory not empty in %srmdir.php on line %d
+Warning: rmdir(): phar error: Directory not empty in %srmdir.php on line 24
bool(false)
a
bool(true)
diff --git a/ext/phar/tests/test_signaturealgos.phpt b/ext/phar/tests/test_signaturealgos.phpt
index 7cbf6c0513..2ef7ca109f 100644
--- a/ext/phar/tests/test_signaturealgos.phpt
+++ b/ext/phar/tests/test_signaturealgos.phpt
@@ -6,7 +6,6 @@ if (!extension_loaded("phar")) die("skip");
if (!extension_loaded("hash")) die("skip extension hash conflicts");
$arr = Phar::getSupportedSignatures();
if (!in_array("OpenSSL", $arr)) die("skip openssl support required");
-if (!in_array('SHA-256', $arr)) die("skip hash extension loaded shared");
?>
--INI--
phar.require_hash=0
diff --git a/ext/phar/tests/zip/bzip2.phpt b/ext/phar/tests/zip/bzip2.phpt
index a703ce6033..f34f1859cd 100644
--- a/ext/phar/tests/zip/bzip2.phpt
+++ b/ext/phar/tests/zip/bzip2.phpt
@@ -11,8 +11,6 @@ try {
foreach ($a as $entry => $file) {
echo $file->getContent();
}
- $a = new Phar(dirname(__FILE__) . '/files/bz2_alias.phar.zip');
- var_dump($a->getAlias());
} catch (Exception $e) {
echo $e->getMessage() . "\n";
}
@@ -79,5 +77,4 @@ $a = new corrupt_zipmaker;
$a->addFile('hi', null, 'hii', null, null, 'compress', 'compress', 11);
$a->writeZip(dirname(__FILE__) . '/compress_unsupunknown.zip');
?>
-string(175) "hitheresuperlongzipistoostupidtodowhatIsaysoIhavetousethisridiculouslylongaliasbecauseitisstupiddidImentionthatalreadythemadnessdoesnotstopIhateinfozipIhateinfozipIhateinfozip"
===DONE===
diff --git a/ext/phar/tests/zip/rmdir.phpt b/ext/phar/tests/zip/rmdir.phpt
index c7ef9dacac..149f0e8d6b 100644
--- a/ext/phar/tests/zip/rmdir.phpt
+++ b/ext/phar/tests/zip/rmdir.phpt
@@ -15,7 +15,6 @@ $phar = new Phar($fname);
$phar->setStub("<?php
Phar::mapPhar('hio');
__HALT_COMPILER(); ?>");
-$phar->addEmptyDir('a');
$phar['a/x'] = 'a';
$phar->stopBuffering();
@@ -32,7 +31,7 @@ var_dump(rmdir($alias . '/a'));
--EXPECTF--
a
-Warning: rmdir(): phar error: Directory not empty in %srmdir.php on line %d
+Warning: rmdir(): phar error: Directory not empty in %srmdir.php on line 16
bool(false)
a
bool(true)