Branch Coverage

lib/DBD/Mock/Session/GenerateFixtures.pm
Criterion Covered Total %
branch 59 66 89.3


line true false branch
51 21 2 if ($args_for) { }
68 18 2 if ($args_for)
77 9 11 if (my $dbh = $args_for{'dbh'}) { }
1 10 elsif (my $fixtures = $args_for{'data'}) { }
9 1 elsif (-e $self->{'fixture_file'}) { }
163 1 17 if $key eq "mocked_prepare"
188 46 14 if not $sql =~ /^INSERT|^UPDATE|^DELETE/i
204 14 46 if ($sql =~ /^INSERT|^UPDATE|^DELETE/i and $retval)
214 6 54 if ref $self->{'bind_params'} and scalar @{$self->{'bind_params'};} > 0
217 0 60 unless ($retval)
222 58 2 unless $sql =~ /BEGIN|COMMIT/
268 2 18 if (ref $retval and not defined $self->{'result'}[-1]{'results'})
295 14 6 if (ref $retval)
322 11 5 if (scalar @retval)
349 3 0 if (ref $retval)
389 6 39 if (ref $rows and scalar keys %{$rows;} == scalar @{$col_names;})
422 2 1 if $attr and ref $attr eq "HASH"
427 1 9 if scalar @{$query_data;} == 0
452 4 2 if (not ref $statement) { }
491 4 2 if (not ref $statement) { }
530 4 2 if (not ref $statement) { }
562 41 21 if (ref $row)
564 8 33 if ($sql =~ /WHERE/i and not $sql =~ /ORDER BY/i) { }
722 38 11 if ($row->{'col_names'})
737 8 12 if (defined $file) { }
754 1 20 if ref $args_for ne "HASH"
764 1 19 if scalar keys %{$args_for;} > 1
768 1 18 unless $ALLOWED_KEYS{$key}
781 0 156 unless defined $result
782 0 156 unless $override_flag
784 156 0 if ($override_flag and scalar @{$result;})
786 0 156 unless my $fh = "IO::File"->new($fixture_file, "w")
789 0 156 unless $fh->close