1 BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
11 my $schema = DBICTest->init_schema();
13 my $cd_rs = $schema->resultset('CD')->search ({ artist => { '!=', undef }});
15 # create some CDs without tracks
16 $cd_rs->create({ artist => 1, title => 'trackless_foo', year => 2010 });
17 $cd_rs->create({ artist => 1, title => 'trackless_bar', year => 2010 });
19 my $tr_count = $schema->resultset('Track')->count;
21 my $tr_rs = $cd_rs->search_related('tracks');
25 while ($tr_rs->next) {
29 is (scalar @tracks, $tr_count, 'Iteration is correct');
30 is ($tr_rs->count, $tr_count, 'Count is correct');
31 is (scalar ($tr_rs->all), $tr_count, 'All is correct');