Branch Coverage

blib/lib/Test/Net/LDAP/Mock/Data.pm
Criterion Covered Total %
branch 141 174 81.0


line true false branch
61 0 206 if (@_) { }
73 0 220 if (@_) { }
91 1 0 if (@_) { }
96 0 1 if ($_[0] and blessed($_[0]) and $_[0]->isa('Net::LDAP::Entry')) { }
100 0 0 unless ($new_entry->isa('Net::LDAP::RootDSE'))
107 1 0 unless ($new_entry->get_value('objectClass'))
124 18 2 if (@_)
129 0 20 wantarray ? :
134 0 6 unless my $dn = shift()
136 2 4 if (@_) { }
142 2 2 unless my $node = $self->root->get_node($dn)
150 1 76 if grep {$_ eq '*';} @$attrs
153 29 48 if (@$attrs) { }
184 4 26 if ($$self{'password_mocked'} and exists $$arg{'password'})
187 1 3 unless (defined $dn)
191 0 3 unless $dn = ldap_explode_dn($dn, 'casefold', 'lower')
194 1 2 unless my $node = $self->root->get_node($dn)
197 1 1 unless (defined $node->password and defined $$arg{'password'} and $node->password eq $$arg{'password'})
203 9 18 if (my $code = $$self{'mock_bind_code'})
206 3 6 if (ref $code eq 'CODE')
212 4 5 if (blessed $code)
217 8 1 if ($code != '0')
222 1 18 if (my $callback = $$arg{'callback'})
234 1 1 if (my $callback = $$arg{'callback'})
246 1 1 if (my $callback = $$arg{'callback'})
264 1 53 unless ($base)
270 41 12 if (defined $filter and not ref $filter and $filter ne '') { }
273 1 40 unless ($f->parse($filter))
282 46 6 defined $$arg{'scope'} ? :
285 2 50 unless (defined $scope)
293 50 0 $base ? :
295 3 47 unless ($base_node)
299 1 46 if $callback
306 77 15 if ($entry and !$filter || $filter->match($entry, $schema))
309 2 75 if $callback
321 0 8 ref $$arg{'dn'} ? :
323 1 7 unless ($dn)
329 2 5 unless ($dn_list)
333 0 0 exists $$arg{'attrs'} ? :
5 0 exists $$arg{'attr'} ? :
339 0 0 exists $$arg{'attrs'} ? :
5 0 exists $$arg{'value'} ? :
347 0 5 unless ($node and $node->entry)
360 3 2 $filter->match($entry, $self->schema) ? :
363 1 4 if (my $callback = $$arg{'callback'})
375 0 40 ref $$arg{'dn'} ? :
377 1 39 unless ($dn)
383 2 37 unless ($dn_list)
389 2 35 if ($node->entry)
395 0 35 if (ref $$arg{'dn'}) { }
398 24 11 unless $$arg{'attrs'} or $$arg{'attr'}
404 35 0 if (my $rdn = $$dn_list[0])
412 1 34 if (my $callback = $$arg{'callback'})
426 0 19 ref $$arg{'dn'} ? :
428 1 18 unless ($dn)
434 2 16 unless ($dn_list)
440 2 14 unless ($node and $node->entry)
446 2 12 if (exists $$arg{'changes'}) { }
451 1 3 unless (defined $opcode{$op})
459 37 11 unless my $chg = $$arg{$op}
463 2 9 if ($opcode == 3) { }
5 4 elsif ($ref_chg eq 'HASH') { }
4 0 elsif ($ref_chg eq 'ARRAY') { }
0 0 elsif (not $ref_chg) { }
465 1 1 if ($ref_chg eq 'HASH') { }
1 0 elsif ($ref_chg eq 'ARRAY') { }
0 0 elsif (not $ref_chg) { }
476 0 2 unless defined $incr
490 1 3 if ($opcode == 1) { }
502 2 11 if (my $callback = $$arg{'callback'})
514 0 8 ref $$arg{'dn'} ? :
516 1 7 unless ($dn)
522 2 5 unless ($dn_list)
528 1 4 unless ($node and $node->entry)
534 1 3 if (my $callback = $$arg{'callback'})
546 0 12 ref $$arg{'dn'} ? :
548 1 11 unless ($dn)
554 2 9 unless ($dn_list)
561 1 8 unless ($old_node and $old_node->entry)
569 7 1 if (defined(my $new_rdn_value = $$arg{'newrdn'})) { }
572 1 6 unless ($new_rdn_list)
583 4 3 if (defined(my $new_superior = $$arg{'newsuperior'})) { }
586 1 3 unless ($dn_list)
600 2 4 if ($new_node->entry)
610 3 1 if ($rdn_changed)
611 2 1 if ($$arg{'deleteoldrdn'})
621 0 4 if (my $callback = $$arg{'callback'})