Skip to content

[12.x] Clear parallel test view cache directories#58525

Merged
taylorotwell merged 1 commit into
laravel:12.xfrom
eduPHP:clear-view-cache-parallel-directories
Jan 28, 2026
Merged

[12.x] Clear parallel test view cache directories#58525
taylorotwell merged 1 commit into
laravel:12.xfrom
eduPHP:clear-view-cache-parallel-directories

Conversation

@eduPHP

@eduPHP eduPHP commented Jan 28, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #58521

Added a directory check and deletion on view:clear

previously, parallel test directories would be left untouched

foreach ($this->files->glob("{$path}/*") as $view) {
    $this->files->delete($view);
}

added directory verification and directory deletion

foreach ($this->files->glob("{$path}/*") as $view) {
    if ($this->files->isDirectory($view)) {
        $this->files->deleteDirectory($view);
    } else {
        $this->files->delete($view);
    }
}

Test

not sure if I should test against real fixture view files then I just mocked the filesystem to go through a sample list and ensured it was calling for deleteDirectory when isDirectory returns true

./vendor/bin/phpunit --filter test_clear_view_command_should_remove_parallel_test_directories

Let me know if it needs any change

@eduPHP eduPHP changed the title Clear parallel test view cache directories [12.x] Clear parallel test view cache directories Jan 28, 2026
@taylorotwell taylorotwell merged commit 34c8e06 into laravel:12.x Jan 28, 2026
22 of 72 checks passed
@eduPHP eduPHP deleted the clear-view-cache-parallel-directories branch January 28, 2026 16:01
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.

view:clear command does not clear parallel test generated directories

2 participants