Branch Coverage

lib/DBIx/EAV.pm
Criterion Covered Total %
branch 76 114 66.6


line true false branch
60 0 1 unless $dsn
62 0 1 if ref $class
67 0 1 unless $constructor_params->{'dbh'} = 'DBI'->connect($dsn, $user, $pass, $attrs)
75 0 138 unless $name
78 90 48 if exists $self->_types->{$name}
82 2 45 unless $type
92 79 0 if exists $self->_types_by_id->{$value}
94 0 0 unless $self->_load_or_register_type('id', $value)
113 41 8 if (not $declarations->{$name}) { }
123 7 1 if $declarations->{$name}{'signature'} eq $signature
144 4 44 if (my $type_row = $self->table('entity_types')->select_one({$field, $value}))
147 0 4 if (my $custom_entity_class = $self->_resolve_entity_class($type_row->{'name'}))
153 0 4 unless my $declaration = $$declarations{$type_row->{'name'}}
157 2 2 if ($declaration->{'signature'} eq $type_row->{'signature'}) { }
176 0 44 unless $field eq 'name'
179 3 40 if (my $custom_entity_class = $self->_resolve_entity_class($value))
184 2 41 unless $declarations->{$value}
198 4 1 if $is_loaded
201 1 0 if $error =~ /^Can't locate .* in \@INC/
215 2 0 if $is_loaded
228 23 67 if (&blessed($name)) { }
229 0 23 unless $name->isa('DBIx::EAV::EntityType')
249 0 41 unless my $declaration = $self->_type_declarations->{$name}
254 0 41 if (my $type = $types_table->select_one({'name', $name}))
261 0 41 unless $type
277 5 38 if $parent_type
285 91 38 unless defined $spec->{$reltype}
288 0 38 unless ref $spec->{$reltype} eq 'ARRAY'
305 5 38 if ($spec->{'extends'}) { }
308 0 5 unless $parent_type = $self->type($spec->{'extends'})
311 0 5 if ($inheritance_row and $inheritance_row->{'parent_type_id'} ne $parent_type->id) { }
5 0 elsif (not $inheritance_row) { }
313 0 0 unless $hierarchy_table->update({'parent_type_id', $parent_type->id}, $inheritance_row)
319 0 5 unless $hierarchy_table->insert({'child_type_id', $type->{'id'}, 'parent_type_id', $parent_type->id})
327 0 38 if ($inheritance_row)
328 0 0 unless $hierarchy_table->delete($inheritance_row)
343 5 38 $type->{'parent'} ? :
348 0 122 if $inherited_attributes{$attr_spec->{'name'}}
355 9 113 if (defined $attr) { }
367 0 113 unless $self->schema->has_data_type($data{'data_type'})
371 0 113 unless $attr
382 0 38 unless $params->{'entity'}
386 19 8 $reltype =~ /_many$/ ? :
390 11 16 $reltype eq 'many_to_many' ? :
407 4 34 if ($existing_rel) { }
417 0 4 if keys %changed_cols > 0
422 0 34 unless $id
448 5 44 if exists $schema->{$_}
456 46 91 unless (ref $attr_spec)
465 0 137 if exists $static_attributes{$attr_spec->{'name'}}
473 105 42 unless $schema->{$reltype}
476 21 21 if (my $reftype = ref $rels) { }
477 0 21 if $reftype ne 'ARRAY'
487 32 10 if (not $reftype) { }
10 0 elsif ($reftype eq 'ARRAY') { }
0 0 elsif ($reftype eq 'HAS') { }
506 0 42 unless $rel{'entity'}