Plack/Middleware/Auth/LemonldapNG.pm untested

filter: Statementstmt 0.0% 0 / 29 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 41 CC 3 SCAR 17.5
CC
3
Cov
0%
call
12.0
prepare_app
2.0
BEGIN
2.0
CRAP 5.8
1 package Plack::Middleware::Auth::LemonldapNG;
2  
3 our $AUTHORITY = 'cpan:GUIMARD';
4 our $VERSION = '2.23.0';
5 our $llclass = 'Lemonldap::NG::Handler::Server';
6  
7 use strict;
8 use base qw(Plack::Middleware);
9 use Plack::Util;
10 use Plack::Util::Accessor qw(
11 llhandler
12 llparams
13 on_reject
14 );
15  
16 sub prepare_app {
17 my ($self) = @_;
18 Plack::Util::load_class($llclass);
19 $self->llhandler( $llclass->run( $self->llparams ) );
20 }
21  
22 sub call {
23 my ( $self, $env ) = @_;
24 my $res = $self->llhandler->($env);
25 my $rejApp = $self->on_reject;
26 unless ( $res->[0] == 200 ) {
27 if ($rejApp) {
28 return $self->$rejApp( $env, $res );
29 }
30 else {
31 return $res;
32 }
33 }
34 my $app = $self->app;
35 @_ = $env;
36 goto $app;
37 }
38  
39 __PACKAGE__;
40 __END__