X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Frelationship%2Fcustom_with_null_in_cond.t;fp=t%2Frelationship%2Fcustom_with_null_in_cond.t;h=e7a7acb25879d6cb8a334e9162df314b1dbf7537;hb=18c294f430dbf1d39af5378a9ae3db54486e15c5;hp=0000000000000000000000000000000000000000;hpb=73eb813b0e8affad8fea1febdd9a495f7eb243f2;p=dbsrgits%2FDBIx-Class.git diff --git a/t/relationship/custom_with_null_in_cond.t b/t/relationship/custom_with_null_in_cond.t new file mode 100644 index 0000000..e7a7acb --- /dev/null +++ b/t/relationship/custom_with_null_in_cond.t @@ -0,0 +1,45 @@ +use strict; +use warnings; + +use Test::More; + +use lib 't/lib'; +use DBICTest; + +my $schema = DBICTest->init_schema(); + +my $artist_rs = $schema->resultset('Artist'); + +for my $rel_rs( + $artist_rs->search_related_rs( + cds_without_genre => { artist => 1 }, { order_by => 'cdid' } + ), + $artist_rs->find(1)->search_related_rs( + cds_without_genre => {}, { order_by => 'cdid' } + ), +) { + + is_deeply( + $rel_rs->all_hri, + [ + { + artist => 1, + cdid => 2, + genreid => undef, + single_track => undef, + title => "Forkful of bees", + year => 2001 + }, + { + artist => 1, + cdid => 3, + genreid => undef, + single_track => undef, + title => "Caterwaulin' Blues", + year => 1997 + }, + ] + ); +} + +done_testing;