File: 50_driver_simplegroup.t

package info (click to toggle)
libcgi-application-plugin-authorization-perl 0.07%2B~cs0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 356 kB
  • sloc: perl: 1,237; makefile: 17
file content (32 lines) | stat: -rw-r--r-- 645 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/perl
use Test::More;
use Test::Exception;
use lib qw(t);

plan tests => 4;

use strict;
use warnings;

{

    package TestAppDriverSimpleGroup;

    use base qw(TestAppDriver);

    __PACKAGE__->authz->config(
        DRIVER       => 'SimpleGroup',
        GET_USERNAME => sub { return $_[0]->cgiapp->param('group') },
    );

    sub cgiapp_init {
        my $self = shift;
        $self->param('group' => 'testgroup');
    }

}

TestAppDriverSimpleGroup->run_authz_success_tests( [qw(testgroup)], [qw(othertestgroup testgroup)] );

TestAppDriverSimpleGroup->run_authz_failure_tests( [qw(badgroup)], [qw(badgroup otherbadgroup)] );