8 my $schema = DBICTest->init_schema();
10 eval "use DBD::SQLite";
11 plan skip_all => 'needs DBD::SQLite for testing' if $@;
14 cmp_ok($schema->resultset("CD")->count({ 'artist.name' => 'Caterwauler McCrae' },
15 { join => 'artist' }),
16 '==', 3, 'Count by has_a ok');
18 cmp_ok($schema->resultset("CD")->count({ 'tags.tag' => 'Blue' }, { join => 'tags' }),
19 '==', 4, 'Count by has_many ok');
21 cmp_ok($schema->resultset("CD")->count(
22 { 'liner_notes.notes' => { '!=' => undef } },
23 { join => 'liner_notes' }),
24 '==', 3, 'Count by might_have ok');
26 cmp_ok($schema->resultset("CD")->count(
27 { 'year' => { '>', 1998 }, 'tags.tag' => 'Cheesy',
28 'liner_notes.notes' => { 'like' => 'Buy%' } },
29 { join => [ qw/tags liner_notes/ ] } ),
30 '==', 2, "Mixed count ok");