use Catalyst::Test 'TestApp';
my $content = get('index.html'); # Content as string
my $response = request('index.html'); # HTTP::Response object
- my($res, $c) = crequest('index.html'); # HTTP::Response & context object
+ my($res, $c) = ctx_request('index.html'); # HTTP::Response & context object
use HTTP::Request::Common;
my $response = request POST '/foo', [
=head1 FUNCTIONS
-=head2 ($res, $c) = crequest( ... );
+=head2 ($res, $c) = ctx_request( ... );
Works exactly like C<Catalyst::Test::request>, except it also returns the
catalyst context object, C<$c>. Note that this only works for local requests.
no strict 'refs';
my $caller = caller(0);
- *{"$caller\::request"} = $request;
- *{"$caller\::get"} = $get;
- *{"$caller\::crequest"} = sub {
+ *{"$caller\::request"} = $request;
+ *{"$caller\::get"} = $get;
+ *{"$caller\::ctx_request"} = sub {
my $me = ref $self || $self;
- ### throw an exception if crequest is being used against a remote
+ ### throw an exception if ctx_request is being used against a remote
### server
Catalyst::Exception->throw("$me only works with local requests, not remote")
if $ENV{CATALYST_SERVER};