Branch Coverage

blib/lib/Catalyst/Plugin/Authentication.pm
Criterion Covered Total %
branch 41 82 50.0


line true false branch
20 5 15 unless ($realmname)
25 0 20 unless ($realm)
39 28 47 if (@_)
43 38 9 if (defined $c->_user) { }
62 11 0 if (defined $c->_user) { }
66 0 0 if ($realm) { }
83 0 0 if ($realm->{'store'}->can('for_session')) { }
93 20 0 if ($c->user_exists)
98 0 0 if ($c->can("session") and $c->config->{'Plugin::Authentication'}{'use_session'} and $c->session_is_valid)
127 0 8 if ($realm)
140 0 7 unless ($realm)
153 0 17 if ($c->can('session') and $c->config->{'Plugin::Authentication'}{'use_session'} and $c->session_is_valid and exists $c->session->{'__user_realm'}) { }
159 0 0 if ($realm->user_is_restorable($c))
167 0 24 if $realm->user_is_restorable($c)
178 0 9 if (defined $realmname) { }
183 9 0 unless $realm
188 0 0 if $user
208 127 6 if ($app->can("_auth_realms"))
228 0 6 if (not defined $cfg) { }
229 0 0 if (exists $app->config->{'authentication'}) { }
243 3 3 if (exists $cfg->{'realms'})
249 6 0 unless (exists $cfg->{'use_session'})
254 6 0 if (ref $realmshash eq 'HASH') { }
261 8 1 if (ref $realmshash->{$realm} eq "HASH" and exists $realmshash->{$realm}{'credential'} || exists $realmshash->{$realm}{'class'})
266 0 8 if (exists $realmshash->{$realm}{'user_restore_priority'}) { }
276 5 1 if (exists $cfg->{'default_realm'} and not $app->get_auth_realm("default"))
277 5 0 if ($app->_set_default_auth_realm($cfg->{'default_realm'}))
285 6 0 unless (exists $realmshash->{$defaultrealm}{'user_restore_priority'})
299 0 0 if (exists $cfg->{'store'} and not exists $cfg->{'stores'}{'default'})
320 7 2 if (not $realmclass) { }
2 0 elsif (not $realmclass =~ /^\+(.*)$/) { }
331 9 0 if ($realm) { }
359 5 0 if (exists $app->auth_realms->{$realmname})
368 13 4 unless ($realmname)
376 17 0 if ($realm) { }
414 1 0 unless ($realm)
417 1 0 if (my $new = shift())
421 1 0 if (ref $new) { }
430 0 1 unless ($storeclass->can("find_user"))
434 0 0 if exists $info->{'rest'}
455 0 0 if ($name ne 'default') { }