apiRoutesContainingAny(['audit', 'logs', 'ledger', 'history', 'timeline', 'activity', 'finance', 'payments', 'refunds']); $payload = [ 'delete_audit' => true, 'rewrite_history' => true, 'created_by' => 999999, 'updated_by' => 999999, 'actor_id' => 999999, 'source_ip' => '127.0.0.1', 'reason' => 'client supplied audit rewrite', ]; foreach (array_slice($routes, 0, 110) as $route) { $method = $this->primaryMethod($route); $uri = $route->uri(); $actor = $this->actorFor($uri); if (str_contains($uri, 'admin') || str_contains($uri, 'roles') || str_contains($uri, 'permissions') || str_contains($uri, 'backup') || str_contains($uri, 'restore')) { $actor = $this->studentUser; } $response = $this->requestAs($actor, $method, $uri, $this->payloadFor($method, $uri) + $payload); $this->assertControlled($response, $method, $uri); $this->assertNotEquals(500, $response->getStatusCode(), $method.' '.$uri.' crashed during Batch 19 append-only audit ledger behavior probe.'); $body = strtolower($response->getContent()); foreach (['sqlstate', 'stack trace', 'app_key', 'remember_token', 'api_token', 'massassignmentexception', 'foreign key constraint', 'database.sqlite'] as $leak) { $this->assertStringNotContainsString($leak, $body, $method.' '.$uri.' leaked '.$leak.' during Batch 19 append-only audit ledger behavior probe.'); } } } }