Skip to content

InMemoryTransport

class Vendidit\AuthServer\Http\InMemoryTransport Source: 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(string $method, string $path, array $response)

@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.

@param array<string,mixed> $response

onError(string $method, string $path, VenAuthException $error)

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