Skip to content

[6.x] Stop Pest reporting thousands of suppressed unlink warnings - #15851

Merged
jasonvarga merged 1 commit into
6.xfrom
fix-skeleton-restore-warnings
Nov 11, 2026
Merged

jasonvarga merged 1 commit into
6.xfrom
fix-skeleton-restore-warnings

Conversation

@jasonvarga

Copy link
Copy Markdown
Member

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 an unlink(): Operation not permitted warning. That's thousands per run. Plain phpunit hides 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 on DeletesDirectories that swallows the expected failure with a scoped error handler instead of @. The skeleton restore, the start-of-process purge and deleteDirectory() all use it.

A full Pest run now reports 0 warnings.

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>
@jasonvarga
jasonvarga merged commit b312b33 into 6.x Nov 11, 2026
65 checks passed
@jasonvarga
jasonvarga deleted the fix-skeleton-restore-warnings branch November 11, 2026 15:21
DanielDarrenJones pushed a commit to DanielDarrenJones/cms that referenced this pull request Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant