Skip to content
rw3iss Auth

InMemoryTransport

class rw3iss\AuthServer\Http\InMemoryTransport src/Http/InMemoryTransport.php ↗

In-memory transport for tests. Pre-loaded with canned responses keyed by “METHOD path”. Records every call so tests can assert against them.

Methods

on()

function on(string $method, string $path, array $response): void

Parameters

  • $responsearray<string,mixed>

Annotations

  • @var array<string,array<int,mixed>> queue of responses per route / private array $responses = []; /* @var list<array{method:string,path:string,body:?array<string,mixed>,headers:array<string,string>,accessToken:?string}> / public array $calls = []; /* Push a successful response for METHOD + path.

onError()

function onError(string $method, string $path, VenAuthException $error): void

Push an error to be thrown on the next match for METHOD + path.