1 package Catalyst::Engine::Test;
4 use base 'Catalyst::Engine::HTTP';
8 Catalyst::Engine::Test - Catalyst Test Engine
12 A script using the Catalyst::Engine::Test module might look like:
17 $ENV{CATALYST_ENGINE} = 'Test';
21 use lib '/path/to/MyApp/lib';
24 MyApp->run('/a/path');
28 This is the Catalyst engine specialized for testing.
30 =head1 OVERLOADED METHODS
32 This class overloads some methods from C<Catalyst::Engine::HTTP>.
42 my $request = shift || '/';
44 unless ( ref $request ) {
46 my $uri = ( $request =~ m/http/i )
48 : URI->new( 'http://localhost' . $request );
50 $request = $uri->canonical;
53 unless ( ref $request eq 'HTTP::Request' ) {
54 $request = HTTP::Request->new( 'GET', $request );
57 my $http = Catalyst::Engine::HTTP::LWP->new(
59 address => '127.0.0.1',
60 hostname => 'localhost'
63 $class->handler($http);
65 return $http->response;
76 Sebastian Riedel, C<sri@cpan.org>
77 Christian Hansen, C<ch@ngmedia.com>
81 This program is free software, you can redistribute it and/or modify it under
82 the same terms as Perl itself.