package Mason::TestHandler;
use strict;
use warnings;
use HTML::Mason::ApacheHandler;
our @ISA = qw(HTML::Mason::ApacheHandler);
sub handler
{
my($r) = @_;
# Remember, $r contains a virtual filename (does not exist on disk).
my @fileList = someMagicToGetFiles($r);
my $testPath = $fileList[0];
# ... VARIOUS ATTEMPTS GO HERE ... #
}
####
...
my $ah = HTML::Mason::ApacheHandler->make_ah($r);
my $mi = $ah->interp;
my $output = $mi->exec($testPath);
####
...
$r->filename($testPath);
my $ah = HTML::Mason::ApacheHandler->make_ah($r);
my $output = $ah->prepare_request($r);
####
...
use HTML::Mason::Interp;
my $mi = HTML::Mason::Interp->new(data_dir => '/a/good/data/dir/',
comp_root => '/a/good/comp/root/',
);
my $c = $mi->make_component(comp_file => $testPath );
my $output = $mi->exec($c);