1 BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
10 my $schema = DBICTest->init_schema();
12 my $art = $schema->resultset('Artist')->find(
13 { 'me.artistid' => 1 },
14 { prefetch => 'cds', order_by => { -desc => 'cds.year' } }
18 $art->cds->search({ year => 1999 })->next->year,
20 'Found expected CD with year 1999 after refined search',
24 $art->cds->count({ year => 1999 }),
26 'Correct refined count',
29 # this still should emit no queries:
30 $schema->is_executed_querycount( sub {
36 'Correct prefetched count',
39 my @years = qw(2001 1999 1997);
40 while (my $cd = $cds->next) {
44 'Correct prefetched cd year',
48 }, 0, 'No queries on prefetched operations');