Introducing DBIx::Class::Schema::SanityChecker
[dbsrgits/DBIx-Class.git] / t / relationship / custom_with_null_in_cond.t
1 BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
3 use strict;
4 use warnings;
5
6 use Test::More;
7
8
9 use DBICTest;
10
11 my $schema = DBICTest->init_schema();
12
13 my $artist_rs = $schema->resultset('Artist');
14
15 for my $rel_rs(
16   $artist_rs->search_related_rs(
17     cds_without_genre => { artist => 1 }, { order_by => 'cdid' }
18   ),
19   $artist_rs->find(1)->search_related_rs(
20     cds_without_genre => {}, { order_by => 'cdid' }
21   ),
22 ) {
23
24   is_deeply(
25     $rel_rs->all_hri,
26     [
27       {
28         artist => 1,
29         cdid => 2,
30         genreid => undef,
31         single_track => undef,
32         title => "Forkful of bees",
33         year => 2001
34       },
35       {
36         artist => 1,
37         cdid => 3,
38         genreid => undef,
39         single_track => undef,
40         title => "Caterwaulin' Blues",
41         year => 1997
42       },
43     ]
44   );
45 }
46
47 done_testing;