ext/standard: applied fixers to improve test robustness - #23136
Conversation
|
@bukka following your comment yesterday I reviewed this one once again, and wanted to double check.
I would make a manual follow up to get these addressed. Files affected by the style-only thematic: |
ebced5a to
f9206bf
Compare
Girgias
left a comment
There was a problem hiding this comment.
There are loads of ZPP tests that should be removed, would make the diff smaller and reduce the test suite aswell.
There was a problem hiding this comment.
This is a ZPP test and should be removed.
f9206bf to
713ec9a
Compare
|
Rebased. |
Girgias
left a comment
There was a problem hiding this comment.
So there are still a few ZPP tests, but everything looks good to me. (I did ignore most of the printf variation tests as those are kinda broken already)
| [2]=> | ||
| string(6) "Line 3" | ||
| } | ||
| file(): Argument #2 ($flags) must be a valid flag value |
There was a problem hiding this comment.
Note for future, it might be a good idea to improve the error message.
| flock(): Argument #2 ($operation) must be of type int, array given | ||
| TypeError: flock(): Argument #2 ($operation) must be of type int, array given | ||
| --- Iteration 4 --- | ||
| flock(): Argument #2 ($operation) must be of type int, array given | ||
| TypeError: flock(): Argument #2 ($operation) must be of type int, array given | ||
| --- Iteration 5 --- | ||
| flock(): Argument #2 ($operation) must be of type int, string given | ||
| TypeError: flock(): Argument #2 ($operation) must be of type int, string given | ||
| --- Iteration 6 --- | ||
| flock(): Argument #2 ($operation) must be of type int, string given | ||
| TypeError: flock(): Argument #2 ($operation) must be of type int, string given | ||
| --- Iteration 7 --- | ||
| flock(): Argument #2 ($operation) must be of type int, string given |
There was a problem hiding this comment.
Seems like we have some ZPP tests here (keep the stream resource one as that's not fully ZPP)
| tempnam(): Argument #2 ($prefix) must not contain any null bytes | ||
| ValueError: tempnam(): Argument #2 ($prefix) must not contain any null bytes | ||
| -- Iteration 6 -- | ||
| tempnam(): Argument #2 ($prefix) must be of type string, array given |
| tempnam(): Argument #1 ($directory) must not contain any null bytes | ||
| ValueError: tempnam(): Argument #1 ($directory) must not contain any null bytes | ||
| -- Iteration 6 -- | ||
| tempnam(): Argument #1 ($directory) must be of type string, array given |
| Warning: Undefined variable $obj in %s on line %d | ||
| register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object | ||
| TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object | ||
|
|
||
| Warning: Undefined variable $obj in %s on line %d | ||
| register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object | ||
| register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object | ||
| register_shutdown_function(): Argument #1 ($callback) must be a valid callback, class bar does not have a method "foo" | ||
| register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object | ||
| register_shutdown_function(): Argument #1 ($callback) must be a valid callback, function "bar" not found or invalid function name |
There was a problem hiding this comment.
Do we really remove bug tests?
| @@ -125,5 +125,5 @@ string(10) "helloworld" | |||
| -- Iteration 20 -- | |||
| string(10) "helloworld" | |||
| -- Iteration 21 -- | |||
| strip_tags(): Argument #2 ($allowed_tags) must be of type array|string|null, resource given | |||
There was a problem hiding this comment.
ZPP test and seems the try catch block is only for this case?
| stristr(): Argument #2 ($needle) must be of type string, array given | ||
| TypeError: stristr(): Argument #2 ($needle) must be of type string, array given | ||
| -- Iteration 9 -- | ||
| stristr(): Argument #2 ($needle) must be of type string, array given | ||
| TypeError: stristr(): Argument #2 ($needle) must be of type string, array given | ||
| -- Iteration 10 -- | ||
| stristr(): Argument #2 ($needle) must be of type string, array given |
| Position of 'Hello' with offset '0' is => int(0) | ||
| Position of 'Hello' with offset '1' is => int(74) | ||
| Position of 'Hello' with offset '' is => int(0) | ||
| Position of 'Hello' with offset 'string12' is => | ||
| strpos(): Argument #3 ($offset) must be of type int, string given |
| @@ -89,11 +89,11 @@ string(6) "m1tatm" | |||
| -- Iteration 6 -- | |||
| string(6) "tm0atm" | |||
| -- Iteration 7 -- | |||
| strtr(): Argument #2 ($from) must be of type string, array given | |||
Asserts error class; extracted from: #22799
GitHub is lagging this, easier to review with: https://diffshub.com/php/php-src/pull/23136