X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Frun%2F17join_count.tl;h=08335e09db51d03f2f808172523d354bfbcd42c0;hb=86efc7500ca480dbdc2f2b9765130e419640fde0;hp=be2c07aa92ababd60a254a2afe2df8807e1f5a1b;hpb=3712e4f41b929456d8fad713ca702e4a48e9a940;p=dbsrgits%2FDBIx-Class.git diff --git a/t/run/17join_count.tl b/t/run/17join_count.tl index be2c07a..08335e0 100644 --- a/t/run/17join_count.tl +++ b/t/run/17join_count.tl @@ -1,22 +1,23 @@ sub run_tests { +my $schema = shift; eval "use DBD::SQLite"; plan skip_all => 'needs DBD::SQLite for testing' if $@; plan tests => 4; -cmp_ok(DBICTest->class("CD")->count({ 'artist.name' => 'Caterwauler McCrae' }, +cmp_ok($schema->resultset("CD")->count({ 'artist.name' => 'Caterwauler McCrae' }, { join => 'artist' }), '==', 3, 'Count by has_a ok'); -cmp_ok(DBICTest->class("CD")->count({ 'tags.tag' => 'Blue' }, { join => 'tags' }), +cmp_ok($schema->resultset("CD")->count({ 'tags.tag' => 'Blue' }, { join => 'tags' }), '==', 4, 'Count by has_many ok'); -cmp_ok(DBICTest->class("CD")->count( +cmp_ok($schema->resultset("CD")->count( { 'liner_notes.notes' => { '!=' => undef } }, { join => 'liner_notes' }), '==', 3, 'Count by might_have ok'); -cmp_ok(DBICTest->class("CD")->count( +cmp_ok($schema->resultset("CD")->count( { 'year' => { '>', 1998 }, 'tags.tag' => 'Cheesy', 'liner_notes.notes' => { 'like' => 'Buy%' } }, { join => [ qw/tags liner_notes/ ] } ),