class PendingTestResponse

Methods

__construct(Container $app, string $serverClass)

Create a pending invocation for the given server.

tools()

Retrieve every page of registered tools.

resources()

Retrieve every page of registered resources.

prompts()

Retrieve every page of registered prompts.

tool(Tool|string $tool, array $arguments = [])

Invoke the given tool.

prompt(Prompt|string $prompt, array $arguments = [])

Invoke the given prompt.

resource(Resource|string $resource, array $arguments = [])

Read the given resource.

completion(Primitive|string $primitive, string $argumentName, string $argumentValue = '', array $currentArgs = [])

Complete an argument for the given primitive.

array
buildCompletionRef(Primitive $primitive)

Build the completion reference for a primitive.

resolvePrimitive(Primitive|string $primitive)

Resolve a primitive class or use the supplied instance.

initializeServer()

Start the server with a testing transport.

mixed
executeRequest(Server $server, JsonRpcRequest $request)

Execute a request and capture protocol errors.

actingAs(Authenticatable $user, string|null $guard = null)

Authenticate the current invocation as the given user.

run(string $method, Primitive|string $primitive, array $arguments = [])

Invoke a primitive through the server's method handler.

string
expandUriTemplate(UriTemplate $template, array $variables)

Expand a resource URI using the supplied variables.

Details

at line 30
__construct(Container $app, string $serverClass)

Create a pending invocation for the given server.

Parameters

Container $app
string $serverClass

at line 39
TestListResponse tools()

Retrieve every page of registered tools.

Return Value

TestListResponse

at line 74
TestListResponse resources()

Retrieve every page of registered resources.

Return Value

TestListResponse

at line 109
TestListResponse prompts()

Retrieve every page of registered prompts.

Return Value

TestListResponse

at line 147
TestResponse tool(Tool|string $tool, array $arguments = [])

Invoke the given tool.

Parameters

Tool|string $tool
array $arguments

Return Value

TestResponse

at line 158
TestResponse prompt(Prompt|string $prompt, array $arguments = [])

Invoke the given prompt.

Parameters

Prompt|string $prompt
array $arguments

Return Value

TestResponse

at line 169
TestResponse resource(Resource|string $resource, array $arguments = [])

Read the given resource.

Parameters

Resource|string $resource
array $arguments

Return Value

TestResponse

at line 180
TestResponse completion(Primitive|string $primitive, string $argumentName, string $argumentValue = '', array $currentArgs = [])

Complete an argument for the given primitive.

Parameters

Primitive|string $primitive
string $argumentName
string $argumentValue
array $currentArgs

Return Value

TestResponse

at line 214
protected array buildCompletionRef(Primitive $primitive)

Build the completion reference for a primitive.

Parameters

Primitive $primitive

Return Value

array

at line 234
protected Primitive resolvePrimitive(Primitive|string $primitive)

Resolve a primitive class or use the supplied instance.

Parameters

Primitive|string $primitive

Return Value

Primitive

at line 244
protected Server initializeServer()

Start the server with a testing transport.

Return Value

Server

at line 259
protected mixed executeRequest(Server $server, JsonRpcRequest $request)

Execute a request and capture protocol errors.

Parameters

Server $server
JsonRpcRequest $request

Return Value

mixed

at line 271
PendingTestResponse actingAs(Authenticatable $user, string|null $guard = null)

Authenticate the current invocation as the given user.

Parameters

Authenticatable $user
string|null $guard

Return Value

PendingTestResponse

at line 292
protected TestResponse run(string $method, Primitive|string $primitive, array $arguments = [])

Invoke a primitive through the server's method handler.

Parameters

string $method
Primitive|string $primitive
array $arguments

Return Value

TestResponse

Exceptions

JsonRpcException

at line 318
protected string expandUriTemplate(UriTemplate $template, array $variables)

Expand a resource URI using the supplied variables.

Parameters

UriTemplate $template
array $variables

Return Value

string