use Test::Simple 'no_plan';
use lib './lib';
use A;
my $a = new A;
ok($a->run);
####
package A;
use base 'CGI::Application';
use base 'B';
use CGI::Application::Plugin::AutoRunmode;
use constant DEBUG => 0;
use strict;
sub setup {
my $self = shift;
$self->start_mode('importme');
$self->mode_param('rm');
}
sub cgiapp_prerun {
my $self = shift;
print STDERR "I am prerun\n" if DEBUG;
# This is needed to use a cgiapp_prerun witth AutoRunmode plugin
CGI::Application::Plugin::AutoRunmode::cgiapp_prerun($self);
}
sub hithere : Runmode {
my $self = shift;
my $out = 'hi, there..';
return $out;
}
1;
####
package B;
use CGI::Application::Plugin::AutoRunmode;
sub importme : Runmode {
my $self = shift;
$self->header_type('redirect');
$self->header_props(-url=>'?rm=hithere');
return 'Redirecting..';
}
1;
####
use base 'CGI::Application';
use CGI::Application::Plugin::AutoRunmode;
use base 'B';
####
use base 'CGI::Application';
use CGI::Application::Plugin::AutoRunmode;
sub useme : Runmode {}