1 BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
10 my $schema = DBICTest->init_schema();
12 cmp_ok($schema->resultset("CD")->count({ 'artist.name' => 'Caterwauler McCrae' },
13 { join => 'artist' }),
14 '==', 3, 'Count by has_a ok');
16 cmp_ok($schema->resultset("CD")->count({ 'tags.tag' => 'Blue' }, { join => 'tags' }),
17 '==', 4, 'Count by has_many ok');
19 cmp_ok($schema->resultset("CD")->count(
20 { 'liner_notes.notes' => { '!=' => undef } },
21 { join => 'liner_notes' }),
22 '==', 3, 'Count by might_have ok');
24 cmp_ok($schema->resultset("CD")->count(
25 { 'year' => { '>', 1998 }, 'tags.tag' => 'Cheesy',
26 'liner_notes.notes' => { 'like' => 'Buy%' } },
27 { join => [ qw/tags liner_notes/ ] } ),
28 '==', 2, "Mixed count ok");