From 64764fb9fac0227f8e0443e7c7519d73aec275b9 Mon Sep 17 00:00:00 2001 From: Murilo Ijanc Date: Sun, 26 Jul 2026 14:58:55 -0300 Subject: Initial import --- tests/RecordingTransport.php | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/RecordingTransport.php (limited to 'tests/RecordingTransport.php') diff --git a/tests/RecordingTransport.php b/tests/RecordingTransport.php new file mode 100644 index 0000000..da93fb3 --- /dev/null +++ b/tests/RecordingTransport.php @@ -0,0 +1,39 @@ +, timeout: float}> */ + public array $calls = []; + + /** @param list $responses */ + public function __construct(private array $responses = []) + { + } + + public function get(string $url, array $headers, float $timeout): Response + { + $this->calls[] = ['url' => $url, 'headers' => $headers, 'timeout' => $timeout]; + + $response = array_shift($this->responses); + if ($response === null) { + throw new NetworkException('no response left for ' . $url); + } + + return $response; + } +} -- cgit v1.3