blib/lib/Smolder/DB/TestFileResult.pm untested

filter: Statementstmt 0.0% 0 / 27 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 35 CC 2 SCAR 12.0
CC
2
Cov
0%
insert_or_replace
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.3
1 package Smolder::DB::TestFileResult;
2 use Class::DBI::AbstractSearch;
3 use strict;
4 use warnings;
5 use base 'Smolder::DB';
6  
7 __PACKAGE__->set_up_table('test_file_result');
8  
9 __PACKAGE__->has_a(project => 'Smolder::DB::Project');
10 __PACKAGE__->has_a(test_file => 'Smolder::DB::TestFile');
11 __PACKAGE__->has_a(smoke_report => 'Smolder::DB::SmokeReport');
12 __PACKAGE__->has_a(
13 added => 'DateTime',
14 inflate => sub { DateTime->from_epoch(epoch => shift, time_zone => 'local') },
15 deflate => sub { shift->epoch },
16 );
17  
18 # make sure added is set to NOW
19 __PACKAGE__->add_trigger(
20 before_create => sub {
21 my $self = shift;
22 $self->_attribute_set(added => DateTime->now(time_zone => 'local'));
23 },
24 );
25  
26 =head1 NAME
27  
28 Smolder::DB::TestFileResult
29  
30 =head1 DESCRIPTION
31  
32 L<Class::DBI> based model class for the 'test_file_result' table in the
33 database.
34  
35 =head1 METHODS
36  
37 =head2 ACCESSOR/MUTATORS
38  
39 Each column in the borough table has a method with the same name that can be
40 used as an accessor and mutator.
41  
42 =cut
43  
44 sub insert_or_replace {
45 my ($class, $params) = @_;
46  
47 if (
48 my $result = $class->retrieve(
49 test_file => $params->{test_file},
50 smoke_report => $params->{smoke_report}
51 )
52 )
53 {
54 $result->delete();
55 }
56 $class->insert($params);
57 }
58  
59 1;