summaryrefslogtreecommitdiff
path: root/ext/standard/tests/file/filegroup_variation3.phpt
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-09-08 12:12:26 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-09-08 15:23:23 +0200
commit7e339a335e87d9c8d0b6994039220890284df63e (patch)
tree4f4445f74094e6c614e1f536024be68f20518d37 /ext/standard/tests/file/filegroup_variation3.phpt
parent2386f655d8181456c66241fd8ceb008bd995a31c (diff)
downloadphp-git-7e339a335e87d9c8d0b6994039220890284df63e.tar.gz
Make null byte error a ValueError
Currently we treat paths with null bytes as a TypeError, which is incorrect, and rather inconsistent, as we treat empty paths as ValueError. We do this because the error is generated by zpp and it's easier to always throw TypeError there. This changes the zpp implementation to throw a TypeError only if the type is actually wrong and throw ValueError for null bytes. The error message is also split accordingly, to be more precise. Closes GH-6094.
Diffstat (limited to 'ext/standard/tests/file/filegroup_variation3.phpt')
-rw-r--r--ext/standard/tests/file/filegroup_variation3.phpt6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/standard/tests/file/filegroup_variation3.phpt b/ext/standard/tests/file/filegroup_variation3.phpt
index 47f519275e..d18da05855 100644
--- a/ext/standard/tests/file/filegroup_variation3.phpt
+++ b/ext/standard/tests/file/filegroup_variation3.phpt
@@ -38,7 +38,7 @@ foreach($files_arr as $file) {
echo "- Iteration $count -\n";
try {
var_dump( filegroup( $file_path."/".$file ) );
- } catch (TypeError $e) {
+ } catch (Error $e) {
echo $e->getMessage(), "\n";
}
clearstatcache();
@@ -75,8 +75,8 @@ bool(false)
Warning: filegroup(): stat failed for %s/filegroup_variation3/filegroup*.tmp in %s on line %d
bool(false)
- Iteration 7 -
-filegroup(): Argument #1 ($filename) must be a valid path, string given
+filegroup(): Argument #1 ($filename) must not contain any null bytes
- Iteration 8 -
-filegroup(): Argument #1 ($filename) must be a valid path, string given
+filegroup(): Argument #1 ($filename) must not contain any null bytes
*** Done ***