1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
package TestAppDriver;
use base qw(CGI::Application);
use CGI::Application::Plugin::Authorization;
use Test::More;
#
# These tests should pass with the parameters that were passed
#
sub run_authz_success_tests {
my $class = shift;
my @testdata = @_;
my $cgiapp = $class->new();
foreach my $data (@testdata) {
# Successful authz
ok($cgiapp->authz->authorize(@$data), 'successful authz');
}
}
#
# These tests should fail with the parameters that were passed
#
sub run_authz_failure_tests {
my $class = shift;
my @testdata = @_;
my $cgiapp = $class->new();
foreach my $data (@testdata) {
# Failed authz
ok(!$cgiapp->authz->authorize(@$data), 'failed authz');
}
}
1;
|