summaryrefslogtreecommitdiff
path: root/ext/phar/tests
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-01-29 20:06:13 +0100
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-02-17 14:22:17 +0100
commitac0853eb265784c4238af652de9c54c883ffa99f (patch)
treee9316872480304e9e74ce89bd15052965cc18438 /ext/phar/tests
parent72bd55902d1908857f47555ad69458861e1acd94 (diff)
downloadphp-git-ac0853eb265784c4238af652de9c54c883ffa99f.tar.gz
Make type error messages more consistent
Closes GH-5092
Diffstat (limited to 'ext/phar/tests')
-rw-r--r--ext/phar/tests/badparameters.phpt36
-rw-r--r--ext/phar/tests/bug64931/bug64931.phpt4
-rw-r--r--ext/phar/tests/create_path_error.phpt2
-rw-r--r--ext/phar/tests/fgc_edgecases.phpt2
-rw-r--r--ext/phar/tests/fopen_edgecases2.phpt2
-rw-r--r--ext/phar/tests/opendir_edgecases.phpt2
-rw-r--r--ext/phar/tests/phar_extract.phpt2
-rw-r--r--ext/phar/tests/phar_oo_006.phpt2
-rw-r--r--ext/phar/tests/phar_unlinkarchive.phpt2
-rw-r--r--ext/phar/tests/pharfileinfo_construct.phpt2
10 files changed, 28 insertions, 28 deletions
diff --git a/ext/phar/tests/badparameters.phpt b/ext/phar/tests/badparameters.phpt
index 3ee49890c9..e086e89c28 100644
--- a/ext/phar/tests/badparameters.phpt
+++ b/ext/phar/tests/badparameters.phpt
@@ -228,40 +228,40 @@ try {
}
?>
--EXPECTF--
-Phar::mungServer() expects parameter 1 to be array, string given
-Phar::createDefaultStub() expects parameter 1 to be a valid path, array given
-Phar::loadPhar() expects parameter 1 to be a valid path, array given
-Phar::canCompress() expects parameter 1 to be int, string given
-Phar::__construct() expects parameter 1 to be a valid path, array given
-Phar::convertToExecutable() expects parameter 1 to be int, array given
-Phar::convertToData() expects parameter 1 to be int, array given
-PharData::delete() expects parameter 1 to be a valid path, array given
+Phar::mungServer() expects argument #1 ($munglist) to be of type array, string given
+Phar::createDefaultStub() expects argument #1 ($index) to be a valid path, array given
+Phar::loadPhar() expects argument #1 ($filename) to be a valid path, array given
+Phar::canCompress() expects argument #1 ($method) to be of type int, string given
+Phar::__construct() expects argument #1 ($filename) to be a valid path, array given
+Phar::convertToExecutable() expects argument #1 ($format) to be of type int, array given
+Phar::convertToData() expects argument #1 ($format) to be of type int, array given
+PharData::delete() expects argument #1 ($entry) to be a valid path, array given
Cannot write out phar archive, phar is read-only
Entry oops does not exist and cannot be deleted
%sfrontcontroller10.phar
Cannot write out phar archive, phar is read-only
A Phar alias cannot be set in a plain tar archive
-Phar::setAlias() expects parameter 1 to be string, array given
+Phar::setAlias() expects argument #1 ($alias) to be of type string, array given
Cannot change stub, phar is read-only
A Phar stub cannot be set in a plain tar archive
-Phar::setStub() expects parameter 1 to be string, array given
+Phar::setStub() expects argument #1 ($newstub) to be of type string, array given
A Phar stub cannot be set in a plain tar archive
-Phar::setDefaultStub() expects parameter 1 to be string, array given
+Phar::setDefaultStub() expects argument #1 ($index) to be of type string, array given
Cannot change stub: phar.readonly=1
Cannot set signature algorithm, phar is read-only
-Phar::compress() expects parameter 1 to be int, array given
+Phar::compress() expects argument #1 ($compression_type) to be of type int, array given
Cannot compress phar archive, phar is read-only
-Phar::compressFiles() expects parameter 1 to be int, array given
+Phar::compressFiles() expects argument #1 ($compression_type) to be of type int, array given
Phar is readonly, cannot change compression
Phar::copy() expects exactly 2 parameters, 1 given
Cannot copy "a" to "b", phar is read-only
-Phar::offsetExists() expects parameter 1 to be a valid path, array given
-Phar::offsetGet() expects parameter 1 to be a valid path, array given
+Phar::offsetExists() expects argument #1 ($entry) to be a valid path, array given
+Phar::offsetGet() expects argument #1 ($entry) to be a valid path, array given
Phar::offsetSet() expects exactly 2 parameters, 1 given
-PharData::offsetUnset() expects parameter 1 to be a valid path, array given
+PharData::offsetUnset() expects argument #1 ($entry) to be a valid path, array given
Write operations disabled by the php.ini setting phar.readonly
-Phar::addEmptyDir() expects parameter 1 to be a valid path, array given
-Phar::addFile() expects parameter 1 to be a valid path, array given
+Phar::addEmptyDir() expects argument #1 ($dirname) to be a valid path, array given
+Phar::addFile() expects argument #1 ($filename) to be a valid path, array given
Phar::addFromString() expects exactly 2 parameters, 1 given
Write operations disabled by the php.ini setting phar.readonly
Phar::setMetadata() expects exactly 1 parameter, 2 given
diff --git a/ext/phar/tests/bug64931/bug64931.phpt b/ext/phar/tests/bug64931/bug64931.phpt
index 6bf3bea7c3..8c25692c3f 100644
--- a/ext/phar/tests/bug64931/bug64931.phpt
+++ b/ext/phar/tests/bug64931/bug64931.phpt
@@ -47,10 +47,10 @@ try {
<?php
@unlink(__DIR__."/bug64931.phar");
?>
---EXPECTF--
+--EXPECT--
Test
CAUGHT: Cannot create any files in magic ".phar" directory
CAUGHT: Cannot create any files in magic ".phar" directory
CAUGHT: Cannot create any files in magic ".phar" directory
CAUGHT: Cannot create any files in magic ".phar" directory
-CAUGHT: Phar::addFromString() expects parameter 1 to be a valid path, string given
+CAUGHT: Phar::addFromString() expects argument #1 ($localname) to be a valid path, string given
diff --git a/ext/phar/tests/create_path_error.phpt b/ext/phar/tests/create_path_error.phpt
index ff4fa4530a..458ec8b6f5 100644
--- a/ext/phar/tests/create_path_error.phpt
+++ b/ext/phar/tests/create_path_error.phpt
@@ -78,4 +78,4 @@ string(5) "query"
11:Error: file_put_contents(phar://%s): Failed to open stream: phar error: invalid path "%s" contains illegal character
12:Error: file_put_contents(phar://%s): Failed to open stream: phar error: invalid path "%s" contains illegal character
13:Error: file_put_contents(phar://%s): Failed to open stream: phar error: invalid path "%s" contains illegal character
-Exception: Phar::offsetSet() expects parameter 1 to be a valid path, string given
+Exception: Phar::offsetSet() expects argument #1 ($entry) to be a valid path, string given
diff --git a/ext/phar/tests/fgc_edgecases.phpt b/ext/phar/tests/fgc_edgecases.phpt
index aa037ca5f8..861933ba4e 100644
--- a/ext/phar/tests/fgc_edgecases.phpt
+++ b/ext/phar/tests/fgc_edgecases.phpt
@@ -49,7 +49,7 @@ include $pname . '/foo/hi';
<?php rmdir(__DIR__ . '/poo'); ?>
<?php unlink(__DIR__ . '/fgc_edgecases.txt'); ?>
--EXPECTF--
-file_get_contents() expects parameter 1 to be a valid path, array given
+file_get_contents() expects argument #1 ($filename) to be a valid path, array given
blah
<?php
echo file_get_contents("foo/" . basename(__FILE__));
diff --git a/ext/phar/tests/fopen_edgecases2.phpt b/ext/phar/tests/fopen_edgecases2.phpt
index 5b520ad0ca..548f50a362 100644
--- a/ext/phar/tests/fopen_edgecases2.phpt
+++ b/ext/phar/tests/fopen_edgecases2.phpt
@@ -38,7 +38,7 @@ include $pname . '/foo/hi';
<?php rmdir(__DIR__ . '/poo'); ?>
<?php unlink(__DIR__ . '/fopen_edgecases2.txt'); ?>
--EXPECTF--
-fopen() expects parameter 1 to be a valid path, array given
+fopen() expects argument #1 ($filename) to be a valid path, array given
blah
test
diff --git a/ext/phar/tests/opendir_edgecases.phpt b/ext/phar/tests/opendir_edgecases.phpt
index 30c137baf2..59deca53c8 100644
--- a/ext/phar/tests/opendir_edgecases.phpt
+++ b/ext/phar/tests/opendir_edgecases.phpt
@@ -55,7 +55,7 @@ include $pname . '/foo';
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
<?php rmdir(__DIR__ . '/poo');
--EXPECTF--
-opendir() expects parameter 1 to be a valid path, array given
+opendir() expects argument #1 ($path) to be a valid path, array given
.
..
foo
diff --git a/ext/phar/tests/phar_extract.phpt b/ext/phar/tests/phar_extract.phpt
index a354e0a608..e5bba5d757 100644
--- a/ext/phar/tests/phar_extract.phpt
+++ b/ext/phar/tests/phar_extract.phpt
@@ -142,7 +142,7 @@ string(3) "hi3"
string(3) "hi2"
bool(false)
Invalid argument, expected a filename (string) or array of filenames
-Phar::extractTo() expects parameter 1 to be a valid path, array given
+Phar::extractTo() expects argument #1 ($pathto) to be a valid path, array given
Invalid argument, extraction path must be non-zero length
Unable to use path "%soops" for extraction, it is a file, must be a directory
Invalid argument, array of filenames to extract contains non-string value
diff --git a/ext/phar/tests/phar_oo_006.phpt b/ext/phar/tests/phar_oo_006.phpt
index 4b1201cc24..5de390600f 100644
--- a/ext/phar/tests/phar_oo_006.phpt
+++ b/ext/phar/tests/phar_oo_006.phpt
@@ -40,7 +40,7 @@ unlink(__DIR__ . '/files/phar_oo_006.phar.php');
__halt_compiler();
?>
--EXPECTF--
-SplFileInfo::setFileClass() expects parameter 1 to be a class name derived from SplFileObject, 'SplFileInfo' given
+SplFileInfo::setFileClass() expects argument #1 ($class_name) to be a class name derived from SplFileObject, 'SplFileInfo' given
MyFile::__construct(phar://%s/a.php)
a.php
MyFile::__construct(phar://%s/b/c.php)
diff --git a/ext/phar/tests/phar_unlinkarchive.phpt b/ext/phar/tests/phar_unlinkarchive.phpt
index 8789c37e79..70b251257d 100644
--- a/ext/phar/tests/phar_unlinkarchive.phpt
+++ b/ext/phar/tests/phar_unlinkarchive.phpt
@@ -92,7 +92,7 @@ __HALT_COMPILER();
Unknown phar archive ""
Unknown phar archive "%sphar_unlinkarchive.phar"
Unknown phar archive "%sphar_unlinkarchive.phar.tar": internal corruption of phar "%sphar_unlinkarchive.phar.tar" (truncated entry)
-Phar::unlinkArchive() expects parameter 1 to be a valid path, array given
+Phar::unlinkArchive() expects argument #1 ($archive) to be a valid path, array given
bool(false)
string(48) "<?php echo "first stub\n"; __HALT_COMPILER(); ?>"
phar archive "%sphar_unlinkarchive.phar" has open file handles or objects. fclose() all file handles, and unset() all objects prior to calling unlinkArchive()
diff --git a/ext/phar/tests/pharfileinfo_construct.phpt b/ext/phar/tests/pharfileinfo_construct.phpt
index 4597660d80..5ac63d82f5 100644
--- a/ext/phar/tests/pharfileinfo_construct.phpt
+++ b/ext/phar/tests/pharfileinfo_construct.phpt
@@ -49,7 +49,7 @@ echo $e->getMessage() . "\n";
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar'); ?>
--EXPECTF--
Cannot open phar file 'phar://%spharfileinfo_construct.phar/oops': internal corruption of phar "%spharfileinfo_construct.phar" (truncated entry)
-PharFileInfo::__construct() expects parameter 1 to be a valid path, array given
+PharFileInfo::__construct() expects argument #1 ($filename) to be a valid path, array given
Cannot access phar file entry '%s' in archive '%s'
Cannot call constructor twice
'%s' is not a valid phar archive URL (must have at least phar://filename.phar)