);
# test complex join (exercise orajoins)
- lives_ok {
- my @hri = $schema->resultset('CD')->search(
+ lives_ok { is_deeply (
+ $schema->resultset('CD')->search(
{ 'artist.name' => 'pop_art_1', 'me.cdid' => { '!=', 999} },
{ join => 'artist', prefetch => 'tracks', rows => 4, order_by => 'tracks.trackid' }
- )->hri_dump->all;
-
- my $expect = [{
+ )->all_hri,
+ [{
artist => 1,
cdid => 1,
genreid => undef,
},
],
year => 2003
- }];
-
- is_deeply (
- \@hri,
- $expect,
- 'Correct set of data prefetched',
- );
-
- } 'complex prefetch ok';
+ }],
+ 'Correct set of data prefetched',
+ ) } 'complex prefetch ok';
# test sequence detection from a different schema
SKIP: {
use base qw/DBIx::Class::ResultSet/;
-sub hri_dump {
- return shift->search ({}, { result_class => 'DBIx::Class::ResultClass::HashRefInflator' });
+sub all_hri {
+ return [ shift->search ({}, { result_class => 'DBIx::Class::ResultClass::HashRefInflator' })->all ];
}
1;
# cds belong to the second and third artist, respectively, and there's no sixth
# row
is_deeply (
- [ $filtered_cd_rs->hri_dump ],
+ $filtered_cd_rs->all_hri,
[
{
'artist' => '2',