1use strict; 2use warnings; 3 4use Test::More tests => 1; 5 6use Contact qw{ 7 -Engine=CGI 8 -TemplateEngine=TT 9}; 10 11use Gantry::Server; 12use Gantry::Engine::CGI; 13 14# these tests must contain valid template paths to the core gantry templates 15# and any application specific templates 16 17my $cgi = Gantry::Engine::CGI->new( { 18 config => { 19 dbconn => 'dbi:SQLite:dbname=app.db', 20 dbuser => 'apache', 21 root => 'html:html/templates', 22 }, 23 locations => { 24 '/' => 'Contact', 25 }, 26} ); 27 28my @tests = qw( 29 / 30); 31 32my $server = Gantry::Server->new(); 33$server->set_engine_object( $cgi ); 34 35SKIP: { 36 37 eval { 38 require DBD::SQLite; 39 }; 40 skip 'DBD::SQLite is required for run tests.', 1 if ( $@ ); 41 42 unless ( -f 'app.db' ) { 43 skip 'app.db sqlite database required for run tests.', 1; 44 } 45 46 foreach my $location ( @tests ) { 47 my( $status, $page ) = $server->handle_request_test( $location ); 48 ok( $status eq '200', 49 "expected 200, received $status for $location" ); 50 51 if ( $status ne '200' ) { 52 print STDERR $page . "\n\n"; 53 } 54 } 55 56} 57