1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
use strict;
use warnings;
use Test::More;
use lib 't/lib';
use DBICTest;
my $schema = DBICTest->init_schema();
my $artist_rs = $schema->resultset('Artist');
for my $rel_rs(
$artist_rs->search_related_rs(
cds_without_genre => { artist => 1 }, { order_by => 'cdid' }
),
$artist_rs->find(1)->search_related_rs(
cds_without_genre => {}, { order_by => 'cdid' }
),
) {
is_deeply(
$rel_rs->all_hri,
[
{
artist => 1,
cdid => 2,
genreid => undef,
single_track => undef,
title => "Forkful of bees",
year => 2001
},
{
artist => 1,
cdid => 3,
genreid => undef,
single_track => undef,
title => "Caterwaulin' Blues",
year => 1997
},
]
);
}
done_testing;
|