Branch Coverage

blib/lib/Mojolicious/Plugin/ContextAuth/DB/Role.pm
Criterion Covered Total %
branch 68 68 100.0


line true false branch
19 1 49 unless ($id)
33 5 44 unless $result->rows
47 5 39 if (&any(sub { not $params{$_}; } , 'role_name', 'context_id'))
52 2 37 if (length $params{'role_name'} > 255 or length $params{'role_name'} < 3)
68 2 35 if $error
77 1 5 unless ($id)
82 1 4 if (ref $id)
114 1 3 if $error
121 7 3 @params % 2 ? :
124 3 5 if (exists $to_update{'role_name'} and length $to_update{'role_name'} > 255 || length $to_update{'role_name'} < 3)
147 2 5 if $error
149 1 4 unless ($result->rows)
177 2 10 if $error
185 1 13 unless ($role_id)
190 1 12 if (ref $role_id)
195 2 10 if (&any(sub { not $params{$_}; } , 'context_id', 'users'))
202 2 8 if (ref $context_id)
219 1 6 unless @{$params{'users'}}
240 1 7 if $error
248 1 14 unless ($role_id)
253 1 13 if (ref $role_id)
259 1 12 unless ($context_id)
264 2 10 if (ref $context_id)
292 1 9 if $error
300 1 14 unless ($role_id)
305 1 13 if (ref $role_id)
310 1 12 if (&any(sub { not $params{$_}; } , 'permissions'))
328 2 8 unless @{$params{'permissions'}}
332 1 14 if ref $permission_id
336 2 12 unless $permission
356 2 10 if $error
364 1 11 unless ($role_id)
369 1 10 if (ref $role_id)
396 1 9 if $error