Repository navigation
[6.x] Stop Pest reporting thousands of suppressed unlink warnings - #15851
Merged
Merged
Conversation
Deleting without knowing the path type means an unlink() or rmdir() is expected to fail, and Pest reports warnings even when they're silenced with `@`, so CI printed thousands of them. Swallow them with a scoped error handler instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DanielDarrenJones
pushed a commit
to DanielDarrenJones/cms
that referenced
this pull request
Nov 12, 2026
…atamic#15851) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI runs the suite through Pest, which reports PHP warnings even when they're silenced with
@. Since #15143, every test ends by deleting whatever it added to the testbench skeleton with@unlink($path) || @rmdir($path), so every directory a test created produced anunlink(): Operation not permittedwarning. That's thousands per run. Plainphpunithides them, which is why the suite looks clean locally.The pattern deliberately never asks whether a path is a file, a directory or a link, because Windows junctions give contradictory answers (#15145). This keeps that approach but moves the attempt into a
removePath()helper onDeletesDirectoriesthat swallows the expected failure with a scoped error handler instead of@. The skeleton restore, the start-of-process purge anddeleteDirectory()all use it.A full Pest run now reports 0 warnings.