[wp-trac] [WordPress Trac] #59406: Undefined and unused variable in WP_Test_Stream::mkdir
WordPress Trac
noreply at wordpress.org
Wed Sep 20 08:04:45 UTC 2023
#59406: Undefined and unused variable in WP_Test_Stream::mkdir
--------------------------+-----------------------------
Reporter: david.binda | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
The `$file` variable is undefined in
https://core.trac.wordpress.org/browser/trunk/tests/phpunit/includes
/class-wp-test-stream.php?rev=55017#L206
Further, the `$plainfile` is not being used:
https://core.trac.wordpress.org/browser/trunk/tests/phpunit/includes
/class-wp-test-stream.php?rev=55017#L204
Since I haven't been able to find a test which would be using the mkdir
method of the stream wrapper, I'm unable to tell what would be the best
approach to fix the method, since replacing the `$file` by `$this->file`
nor by `$plaifile` does not seem to prevent repeated directory creations.
I'm attaching a patch which, IMHO, makes the method to work, but I'm not
sure if it's the best approach.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59406>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list