shouldReceive('execute') ->once() ->with('public', '/') ->andReturn([ 'db_orphans_removed' => 1, 'disk_orphans_removed' => 2, ]); $this->instance(PruneOrphanedFiles::class, $actionMock); $this->artisan('system:prune-files') ->expectsOutput('Starting file reconciliation...') ->expectsOutput('Reconciliation complete.') ->expectsOutput('- DB Orphans Removed: 1') ->expectsOutput('- Disk Stranded Files Removed: 2') ->assertExitCode(0); });