first commit.

This commit is contained in:
kj
2026-10-05 15:08:39 -03:00
commit b7799f9fff
93 changed files with 8966 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
<?php
namespace Tests\Support;
/**
* Respuesta capturada de una petición despachada in-process.
*/
class Response
{
public function __construct(
public int $status,
public string $body,
public array $headers = [],
public array $cookies = [],
) {
}
public function header(string $name): ?string
{
foreach ($this->headers as $header) {
if (stripos($header, $name . ':') === 0) {
return trim(substr($header, strlen($name) + 1));
}
}
return null;
}
public function hasHeader(string $name): bool
{
return $this->header($name) !== null;
}
public function redirectTarget(): ?string
{
return $this->header('HX-Redirect') ?? $this->header('Location');
}
public function trigger(): ?string
{
return $this->header('HX-Trigger');
}
}