stas 2004/11/05 13:29:46
Modified: t/conf modperl_extra.pl t/modules apache_status.t Log: test Apache::Status::menu_item Revision Changes Path 1.62 +12 -0 modperl-2.0/t/conf/modperl_extra.pl Index: modperl_extra.pl =================================================================== RCS file: /home/cvs/modperl-2.0/t/conf/modperl_extra.pl,v retrieving revision 1.61 retrieving revision 1.62 diff -u -u -r1.61 -r1.62 --- modperl_extra.pl 21 Aug 2004 00:27:22 -0000 1.61 +++ modperl_extra.pl 5 Nov 2004 21:29:46 -0000 1.62 @@ -118,6 +118,18 @@ } } +### Apache::Status tests +use Apache::Status; +use Apache::Module; +Apache::Status->menu_item( + 'test_menu' => "Test Menu Entry", + sub { + my($r, $q) = @_; #request and CGI objects + return ["This is just a test entry"]; + } +) if Apache::Module::loaded('Apache::Status'); + + # this is needed for TestModperl::ithreads # one should be able to boot ithreads at the server startup and then # access the ithreads setup at run-time when a perl interpreter is 1.5 +13 -2 modperl-2.0/t/modules/apache_status.t Index: apache_status.t =================================================================== RCS file: /home/cvs/modperl-2.0/t/modules/apache_status.t,v retrieving revision 1.4 retrieving revision 1.5 diff -u -u -r1.4 -r1.5 --- apache_status.t 3 Aug 2004 16:16:22 -0000 1.4 +++ apache_status.t 5 Nov 2004 21:29:46 -0000 1.5 @@ -10,9 +10,9 @@ my @opts = qw(script myconfig rgysubs section_config env isa_tree symdump inc inh_tree sig); -plan tests => @opts + 1, need +plan tests => @opts + 3, need { "CGI.pm (2.93 or higher) or Apache::Request is needed" => - !!(eval { require CGI && $CGI::VERSION >= 2.93 } || + !!(eval { require CGI && $CGI::VERSION >= 2.93 } || eval { require Apache::Request })}; { @@ -24,6 +24,17 @@ t_debug $pver; # expecting: Embedded Perl version v5.8.2 for ... ok $body =~ /$pver/; + + # menu_item, part 1 + # expecting: Test Entry + ok $body =~ /Test Menu Entry/; +} + +{ + # menu_item, part 2 + my $url = "$base_url?test_menu"; + my $body = GET_BODY_ASSERT $url; + ok $body =~ /This is just a test entry/; } for my $opt (@opts) {