create([ 'workspace_id' => (int) $tenant->workspace_id, 'managed_environment_id' => (int) $tenant->getKey(), ]); $service = app(StartTenantConfigurationCapture::class); $first = $service->start($tenant, $connection, $user, ['deviceAndAppManagementAssignmentFilter']); $second = $service->start($tenant, $connection, $user, ['deviceAndAppManagementAssignmentFilter']); expect($second->getKey())->toBe($first->getKey()) ->and($first->status)->toBe(OperationRunStatus::Queued->value) ->and(json_encode($first->context, JSON_THROW_ON_ERROR))->not->toContain('client_secret') ->and(json_encode($first->context, JSON_THROW_ON_ERROR))->not->toContain('access_token'); Queue::assertPushed(CaptureTenantConfigurationEvidenceJob::class, 1); });