Added quote char test, supported quoting in S::A subclass for joins
[dbsrgits/DBIx-Class.git] / t / 17join_count.t
CommitLineData
47bbe592 1use strict;
2use warnings;
3
4use Test::More;
5
6eval "use DBD::SQLite";
7plan skip_all => 'needs DBD::SQLite for testing' if $@;
8plan tests => 5;
9
10use lib 't/lib';
11
12use_ok('DBICTest');
13
14cmp_ok(DBICTest::CD->count({ 'artist.name' => 'Caterwauler McCrae' },
15 { join => 'artist' }),
16 '==', 3, 'Count by has_a ok');
17
18cmp_ok(DBICTest::CD->count({ 'tags.tag' => 'Blue' }, { join => 'tags' }),
19 '==', 4, 'Count by has_many ok');
20
21cmp_ok(DBICTest::CD->count(
22 { 'liner_notes.notes' => { '!=' => undef } },
23 { join => 'liner_notes' }),
24 '==', 3, 'Count by might_have ok');
25
26cmp_ok(DBICTest::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");