2 # ABSTRACT: HTTP::AnyUA backend for testing GraphQL::Client::http
7 use Scalar
::Util
qw(blessed);
10 use parent
'HTTP::AnyUA::Backend';
14 $response = $backend->response;
15 $response = $backend->response($response);
17 Get
and set the response hashref
or L
<Future
> that this backend will always respond with
.
21 sub response
{ @_ == 2 ? $_[0]->{response
} = pop : $_[0]->{response
} }
25 @requests = $backend->requests;
27 Get the requests the backend
has handled so far
.
31 sub requests
{ @{$_[0]->{requests
} || []} }
33 sub response_is_future
{ blessed
($_[0]->{response
}) && $_[0]->{response
}->isa('Future') }
38 push @{$self->{requests
} ||= []}, [@_];
40 return $self->response || {
43 reason
=> 'Internal Exception',
44 content
=> "No response mocked.\n",