Branch Coverage

blib/lib/Net/OATH/Server/Lite/Endpoint/User.pm
Criterion Covered Total %
branch 58 72 80.5


line true false branch
29 0 0 if $handler
65 1 19 unless $data_handler and $data_handler->isa('Net::OATH::Server::Lite::DataHandler')
71 0 19 unless $request->method eq 'POST'
76 19 0 if $request->content
78 1 18 if $@
80 1 9 unless (defined $$content{'method'} and $$content{'method'} eq 'create' || $$content{'method'} eq 'read' || $$content{'method'} eq 'update' || $$content{'method'} eq 'delete')
91 4 13 if ($$content{'method'} eq 'create')
92 1 3 if ($$content{'id'}) { }
100 1 2 if $$content{'type'}
101 0 3 if $$content{'algorithm'}
102 0 3 if $$content{'digits'}
103 0 3 if $$content{'counter'}
104 0 3 if $$content{'period'}
105 1 2 unless $user->is_valid
107 1 1 unless ($data_handler->insert_user($user))
118 4 10 if ($$content{'method'} eq 'read')
119 3 1 if ($$content{'id'}) { }
120 2 1 unless $user = $data_handler->select_user($$content{'id'})
132 5 6 if ($$content{'method'} eq 'update')
133 4 1 if ($$content{'id'}) { }
134 1 3 unless $user = $data_handler->select_user($$content{'id'})
140 3 0 if $$content{'type'}
141 0 3 if $$content{'algorithm'}
142 0 3 if $$content{'digits'}
143 1 2 if $$content{'counter'}
144 0 3 if $$content{'period'}
145 1 2 unless $user->is_valid
147 1 1 unless ($data_handler->update_user($user))
160 4 3 if ($$content{'method'} eq 'delete')
161 3 1 if ($$content{'id'}) { }
162 1 2 unless $user = $data_handler->select_user($$content{'id'})
168 1 1 unless ($data_handler->delete_user($user->id))
181 1 3 $$content{'method'} eq 'delete' ? :
190 16 0 if ($_->isa('Net::OATH::Server::Lite::Error')) { }
194 8 8 if $_->description
209 0 3 unless $user and $user->isa('Net::OATH::Server::Lite::Model::User')