| 1 | package DBIO::Test::MooCakeSchema::Result::CD; | ||||||||||||
| 2 | # ABSTRACT: Moo + Cake test result class for the cd table (no custom ResultSet) | ||||||||||||
| 3 | |||||||||||||
| 4 | 3 | our $VERSION = '0.900007'; | |||||||||||
| 5 | |||||||||||||
| 6 | 3 | ▶ | use DBIO::Moo; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 3 | ▶ | use DBIO::Cake; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | |||||||||||||
| 9 | 3 | table 'cd'; | |||||||||||
| 10 | |||||||||||||
| 11 | 3 | col id => integer auto_inc; | |||||||||||
| 12 | 3 | col artist_id => integer; | |||||||||||
| 13 | 3 | col title => varchar(100); | |||||||||||
| 14 | 3 | col year => integer null; | |||||||||||
| 15 | |||||||||||||
| 16 | 3 | primary_key 'id'; | |||||||||||
| 17 | |||||||||||||
| 18 | 3 | __PACKAGE__->belongs_to( artist => 'DBIO::Test::MooCakeSchema::Result::Artist', 'artist_id' ); | |||||||||||
| 19 | |||||||||||||
| 20 | 3 | has full_title => ( is => 'lazy' ); | |||||||||||
| 21 | 1 | ▶ | sub _build_full_title { | ||||||||||
|
Subroutine
_build_full_title: called CC=2 SCAR=7.1
| |||||||||||||
| 22 | 1 | my $self = shift; | |||||||||||
| 23 | 1 | ▶ | my $year = $self->year // '?'; | ||||||||||
|
Condition50%1/2
$self->year // "?"
MC/DC0%0/1
$self->year // "?"
$self->year
Truth table50%1/2
A
A= $self->year
| |||||||||||||
| 24 | 1 | sprintf '%s (%s)', $self->title, $year; | |||||||||||
| 25 | } | ||||||||||||
| 26 | |||||||||||||
| 27 | 1 | ▶ | has rating => ( is => 'rw', lazy => 1, default => sub { 0 } ); | ||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||
| 28 | |||||||||||||
| 29 | 3 | 1; | |||||||||||
| 30 | |||||||||||||
| 31 | __END__ | ||||||||||||