blib/lib/DBIO/Test/Schema/Artwork.pm

filter: Statementstmt 92.5% 25 / 27 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 80.0% 4 / 5 Podpod n/a totaltotal 82.8% 29 / 35 CC 2 SCAR 9.8
CC
2
Cov
86%
__ANON__
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« blib/lib/DBIO/Storage/DBI/IdentityInsert.pm ↑ Summary blib/lib/DBIO/Replicated/Backend.pm »
1 package DBIO::Test::Schema::Artwork;
2 # ABSTRACT: Test result class for the cd_artwork table
3  
4 256 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 256 our $VERSION = '0.900007';
7  
8 256 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 256 ▶use base 'DBIO::Test::BaseResult';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 256 ▶use DBIO::Test::Util 'check_customcond_args';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 256 __PACKAGE__->table('cd_artwork');
14 256 __PACKAGE__->add_columns(
15 'cd_id' => {
16 data_type => 'integer',
17 is_nullable => 0,
18 },
19 );
20 256 __PACKAGE__->set_primary_key('cd_id');
21 256 __PACKAGE__->belongs_to('cd', 'DBIO::Test::Schema::CD', 'cd_id');
22 256 __PACKAGE__->has_many('images', 'DBIO::Test::Schema::Image', 'artwork_id');
23  
24 256 __PACKAGE__->has_many('artwork_to_artist', 'DBIO::Test::Schema::Artwork_to_Artist', 'artwork_cd_id');
25 256 __PACKAGE__->many_to_many('artists', 'artwork_to_artist', 'artist');
26  
27 # both to test manytomany with custom rel
28 256 __PACKAGE__->many_to_many('artists_test_m2m', 'artwork_to_artist', 'artist_test_m2m');
29 256 __PACKAGE__->many_to_many('artists_test_m2m_noopt', 'artwork_to_artist', 'artist_test_m2m_noopt');
30  
31 # other test to manytomany
32 __PACKAGE__->has_many('artwork_to_artist_test_m2m', 'DBIO::Test::Schema::Artwork_to_Artist',
33 0 ▶ sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
34 # This is for test purposes only. A regular user does not
35 # need to sanity check the passed-in arguments, this is what
36 # the tests are for :)
37 0 my $args = &check_customcond_args;
38  
39 return (
40 { "$args->{foreign_alias}.artwork_cd_id" => { -ident => "$args->{self_alias}.cd_id" },
41 },
42 $args->{self_result_object} && {
43 "$args->{foreign_alias}.artwork_cd_id" => $args->{self_result_object}->cd_id,
44 }
45 0 ▶ );
Condition0%0/2
$args->{'self_result_object'} && {"$args->{'foreign_alias'}.artwork_cd_id", $args->{'self_result_object'}->cd_id}
!ll
00
MC/DC0%0/1
$args->{'self_result_object'} && {"$args->{'foreign_alias'}.artwork_cd_id", $args->{'self_result_object'}->cd_id}
$args->{'self_result_object'}
Truth table0%0/2
A
A= $args->{'self_result_object'}
Aresult
00
11
46 }
47 256 );
48 256 __PACKAGE__->many_to_many('artists_test_m2m2', 'artwork_to_artist_test_m2m', 'artist');
49  
50 256 1;
51  
52 __END__
« blib/lib/DBIO/Storage/DBI/IdentityInsert.pm ↑ Summary blib/lib/DBIO/Replicated/Backend.pm »