Branch Coverage

blib/lib/Dancer2/Plugin/HTTP/Auth/Extensible.pm
Criterion Covered Total %
branch 70 98 71.4


line true false branch
19 3 6 @_ == 2 ? :
23 0 11 if (not $coderef or ref $coderef ne 'CODE')
28 5 5 unless ($user)
74 0 8 @_ == 3 ? :
79 0 8 if (not $coderef or ref $coderef ne 'CODE')
84 0 8 unless ($user)
96 3 5 ref $require_role eq 'ARRAY' ? :
100 5 3 if ($mode eq 'single') { }
1 2 elsif ($mode eq 'any') { }
2 0 elsif ($mode eq 'all') { }
102 4 6 if _smart_match($_, $require_role)
107 1 1 if $role_ok{$_}
112 1 3 unless (user_has_role($dsl, $role))
118 3 5 unless ($role_match)
142 13 5 if (http_authenticate_user($dsl, $realm)) { }
160 0 4 if (@_ == 2) { }
167 0 4 unless defined $username
172 3 4 if $has_role eq $want_role
184 6 4 unless defined $username
186 0 10 $realm ? :
189 0 10 unless defined $roles
190 6 4 wantarray ? :
202 4 14 unless ($dsl->request->header('Authorization'))
203 0 4 wantarray ? :
216 14 0 $realm ? :
221 13 1 if ($provider->authenticate_user($username, $password))
227 0 13 wantarray ? :
236 0 1 wantarray ? :
244 25 4 if (1 == keys %{plugin_setting()->{'realms'};})
247 4 0 if (exists plugin_setting()->{'default_realm'})
265 1 60 unless (grep {$realm eq $_;} keys %{plugin_setting()->{'realms'};})
286 5 0 if (exists plugin_setting()->{'realms'}{$realm}{'scheme'}) { }
304 0 0 unless (grep(($scheme eq $_), ('Basic', 'Digest')))
320 2 27 unless (exists $dsl->vars->{'http_username'})
326 2 27 if (@_ == 1)
337 1 28 unless exists $dsl->vars->{'http_username'}
348 2 30 unless (exists $dsl->vars->{'http_realm'})
354 2 30 if (@_ == 1)
365 1 31 unless exists $dsl->vars->{'http_realm'}
384 34 3 if exists $realm_provider{$realm}
388 0 3 unless my $realm_settings = plugin_setting()->{'realms'}{$realm}
390 0 3 unless my $provider_class = $$realm_settings{'provider'}
394 3 0 unless ($provider_class =~ /::/)
399 0 3 unless ($ok)
421 0 0 unless ($provider->can($method))
424 0 0 if (defined(my $result = $provider->$method(@args)))
441 8 2 if (not ref $want) { }
2 0 elsif (ref $want eq 'Regexp') { }
0 0 elsif (ref $want eq 'ARRAY') { }