create(); $this->mock(FindingsLifecycleBackfillRunbookService::class, function ($mock) use ($run): void { $mock->shouldReceive('start') ->once() ->withArgs(function ($scope, $initiator, $reason, $source): bool { return $scope instanceof FindingsLifecycleBackfillScope && $scope->isAllTenants() && $initiator === null && $reason instanceof RunbookReason && $source === 'deploy_hook'; }) ->andReturn($run); }); $this->artisan('tenantpilot:run-deploy-runbooks') ->assertExitCode(0); });