Branch Coverage

lib/DBD/Mock/Session/GenerateFixtures.pm
Criterion Covered Total %
branch 67 80 83.7


line true false branch
57 23 2 if ($args_for) { }
74 20 2 if ($args_for)
83 9 13 if (my $dbh = $args_for{'dbh'}) { }
3 10 elsif (my $fixtures = $args_for{'data'}) { }
9 1 elsif (-e $self->{'fixture_file'}) { }
173 4 18 if $key =~ /^mocked/
198 43 14 if not $sql =~ /^INSERT|^UPDATE|^DELETE/i
214 14 43 if ($sql =~ /^INSERT|^UPDATE|^DELETE/i and $retval)
224 0 57 if ref $self->{'bind_params'} and scalar @{$self->{'bind_params'};} > 0
226 3 45 if ($self->{'bind_named_params'} and scalar keys %{$$self{"bind_named_params"};})
233 0 57 unless ($retval)
238 56 1 unless $sql =~ /BEGIN_WORK|COMMIT/
262 5 37 if ($self->{'bind_named_params'} and scalar keys %{$$self{"bind_named_params"};})
287 10 4 if ($bind =~ /^:/) { }
312 2 4 if ($param_num =~ /^:/) { }
336 0 0 unless $bind or $val
337 6 0 if ($bind =~ /^:/) { }
363 0 0 if ($bind =~ /^:/) { }
391 2 15 if (ref $retval and not defined $self->{'result'}[-1]{'results'})
418 12 5 if (ref $retval)
445 9 4 if (scalar @retval)
472 3 0 if (ref $retval)
512 6 39 if (ref $rows and scalar keys %{$rows;} == scalar @{$col_names;})
545 2 1 if $attr and ref $attr eq "HASH"
550 1 9 if scalar @{$query_data;} == 0
575 4 2 if (not ref $statement) { }
614 4 2 if (not ref $statement) { }
653 4 2 if (not ref $statement) { }
685 39 20 if (ref $row)
840 4 102 if (defined $_ and $_ eq '<CURSOR>') { }
841 37 11 if ($row->{'col_names'})
856 8 14 if (defined $file) { }
873 1 22 if ref $args_for ne "HASH"
883 1 21 if scalar keys %{$args_for;} > 1
887 1 20 unless $ALLOWED_KEYS{$key}
900 0 147 unless defined $result
901 0 147 unless $override_flag
903 147 0 if ($override_flag and scalar @{$result;})
905 0 147 unless my $fh = "IO::File"->new($fixture_file, "w")
908 0 147 unless $fh->close