Branch Coverage

blib/lib/Mojolicious/Plugin/ContextAuth/DB/User.pm
Criterion Covered Total %
branch 90 90 100.0


line true false branch
21 1 63 unless ($id)
35 10 53 unless $result->rows
49 5 35 if (&any(sub { not $params{$_}; } , 'username', 'user_password'))
59 2 33 if (length $params{'username'} > 255 or length $params{'username'} < 3)
75 1 32 if $error
84 2 8 unless ($id)
89 1 7 if (ref $id)
121 1 6 if $error
128 3 8 @params % 2 ? :
131 4 7 if (length $to_update{'username'} > 255 or length $to_update{'username'} < 3)
138 5 2 if exists $to_update{'user_password'}
153 1 6 if $error
155 1 5 unless ($result->rows)
205 1 4 if $error
213 1 16 unless ($user_id)
218 2 14 if (ref $user_id)
223 2 12 if (&any(sub { not $params{$_}; } , 'context_id', 'roles'))
230 1 11 if (ref $context_id)
247 1 8 unless @{$params{'roles'}}
268 2 9 if $error
276 1 10 unless ($user_id)
281 1 9 if (ref $user_id)
288 1 8 unless ($context_id)
293 2 6 if (ref $context_id)
300 4 2 if ($params{'role'})
306 2 4 if ($params{'role_id'})
334 3 2 unless $hash
343 1 5 if $error
344 3 2 unless $has_role
352 1 13 unless ($user_id)
357 1 12 if (ref $user_id)
363 1 11 unless ($context_id)
368 1 10 if (ref $context_id)
399 1 9 if $error
407 1 8 unless ($user_id)
412 1 7 if (ref $user_id)
417 2 5 if (&any(sub { not $params{$_}; } , 'context_id', 'permission_id'))
424 1 4 if (ref $context_id)
431 1 3 if (ref $permission_id)
463 1 1 unless $hash
472 1 2 if $error
473 1 1 unless $has_permission
481 1 5 unless ($user_id)
486 1 4 if (ref $user_id)
515 1 3 if $error