Branch Coverage

lib/DBIx/EAV/Entity.pm
Criterion Covered Total %
branch 72 108 66.6


line true false branch
19 67 83 if exists $self->raw->{'id'}
24 0 654 unless exists $self->raw->{'id'}
35 64 10 if $type->has_attribute($name)
38 10 0 if ($type->has_relationship($name))
43 1 7 if $rel->{'is_has_one'} or $rel->{'is_has_many'} and $rel->{'is_right_entity'}
46 0 9 wantarray ? :
56 1 22 $rel->{'is_right_entity'} ? :
68 0 76 unless defined $self->id
74 76 0 if @attrs == 0
94 0 76 unless ref $data eq 'HASH'
119 0 88 if 1 > $numargs or $numargs > 2
122 2 86 if ($numargs == 2) { }
86 0 elsif ($numargs == 1) { }
126 0 86 unless ref $_[0] eq 'HASH'
139 13 127 if ($type->has_relationship($attr_name))
145 0 127 if $attr_name eq 'id'
152 0 6 if defined $value and exists $self->raw->{$attr_name} and defined $self->raw->{$attr_name} and $value eq $self->raw->{$attr_name}
156 125 2 unless exists $self->_modified->{$attr_name}
169 0 0 unless ref $data eq 'HASH' or ref $data eq 'ARRAY' or &blessed($data) and $data->isa('DBIx::EAV::Entity')
173 0 3 if ref $data eq 'ARRAY' and $rel->{'is_has_one'} || $rel->{'is_has_many'} && $rel->{'is_right_entity'}
193 81 4 if ($is_new_entity)
202 0 81 unless $id > 0
208 0 81 unless $static_attributes->{'id'} == $id
228 2 120 if ($attr_spec->{'is_static'})
241 1 119 if (not defined $value) { }
1 118 elsif (defined $old_value) { }
264 85 0 if ($modified_count > 0)
266 1 84 if keys %modified_static_attributes > 0
281 0 14 $rel->{'is_right_entity'} ? :
289 13 1 unless $options->{'keep_current_links'}
292 14 0 ref $data eq 'ARRAY' ? :
295 19 22 if (&blessed($entity)) { }
22 0 elsif (ref $entity eq 'HASH') { }
297 0 19 unless $entity->isa('DBIx::EAV::Entity')
300 0 19 unless $entity->type->id == $related_type->id
303 0 19 unless $entity->in_storage
311 1 18 unless $rel->{'is_many_to_many'}
326 0 41 unless $relationship_table->insert({'relationship_id', $rel->{'id'}, $our_side . '_entity_id', $self->id, $their_side . '_entity_id', $entity->id})
336 0 1 if $rel->{'is_has_one'} or $rel->{'is_has_many'} and $rel->{'is_right_entity'}
347 0 1 if $rel->{'is_has_one'} or $rel->{'is_has_many'} and $rel->{'is_right_entity'}
350 0 1 $rel->{'is_right_entity'} ? :
353 1 0 unless ref $data eq 'ARRAY'
357 0 1 unless &blessed($entity) and $entity->isa('DBIx::EAV::Entity') and $entity->is_type($related_type->name)
383 0 16 unless $self->in_storage
394 4 13 if $rel->{'is_right_entity'} or $rel->{'is_many_to_many'} or exists $rel->{'cascade_delete'} and $rel->{'cascade_delete'} == 0
402 0 16 unless ($eav->schema->database_cascade_delete)
433 0 20 if ref $class
440 0 11 if ref $class
441 0 11 unless $class->is_custom_class
445 3 8 unless (defined *{"${class}::__TYPE_DEFINITION__";})
450 1 2 if $parent_class ne 'DBIx::EAV::Entity'
466 0 7 if ref $class
467 0 7 unless $class->is_custom_class
470 6 1 $stuff eq 'attribute' ? :