apiRoutes(), fn ($route) => in_array($this->primaryMethod($route), ['POST', 'PUT', 'PATCH'], true)), 0, 160);
$script = '
';
foreach ($routes as $route) {
$method = $this->primaryMethod($route);
$uri = $route->uri();
$payload = $this->payloadFor($method, $uri) + [
'name' => $script,
'title' => $script,
'description' => $script,
'notes' => $script,
'comment' => $script,
'message' => $script,
];
$response = $this->requestAs($this->actorFor($uri), $method, $uri, $payload);
$this->assertControlled($response, $method, $uri);
$this->assertNoServerError($response, 'HTML/script payload at ' . $method . ' ' . $uri);
$this->assertStringNotContainsString('', $response->getContent());
$this->assertStringNotContainsString('onerror=alert(1)', $response->getContent());
}
}
}