X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fresultset%2Finflate_result_api.t;fp=t%2Fresultset%2Finflate_result_api.t;h=db7c8740e43ef20a106a10169a1d705f370a549f;hb=aa1d8a8751baf1e4c06b43f38ff9e02cdea51e6a;hp=a6914d95cef1909ece2dfc9657b8ef2ed13058a3;hpb=e81b50f4f429e1119fc6efb369122225fa7557d8;p=dbsrgits%2FDBIx-Class.git diff --git a/t/resultset/inflate_result_api.t b/t/resultset/inflate_result_api.t index a6914d9..db7c874 100644 --- a/t/resultset/inflate_result_api.t +++ b/t/resultset/inflate_result_api.t @@ -419,6 +419,43 @@ cmp_structures ( 'Non-Collapsing chained has_many' ); +$schema->resultset('Artist')->create({ name => "${_}_cdless" }) + for (qw( Z A )); + +cmp_structures ( + [$schema->resultset ('Artist')->search ({}, { + result_class => 'DBICTest::_IRCapture', + collapse => 1, + join => 'cds', + columns => [qw( cds.title cds.artist )], + order_by => [qw( me.name cds.title )], + })->all], + [ + [ + undef, + { cds => bless( [ + [ { artist => undef, title => undef } ] + ], 'DBIx::ResultParser::RelatedNullBranch' ) }, + ], + [ + undef, + { cds => [ + [ { artist => 1, title => "Equinoxe" } ], + [ { artist => 1, title => "Magnetic Fields" } ], + [ { artist => 1, title => "Oxygene" } ], + [ { artist => 1, title => "fuzzy_1" } ], + ] } + ], + [ + undef, + { cds => bless( [ + [ { artist => undef, title => undef } ] + ], 'DBIx::ResultParser::RelatedNullBranch' ) }, + ], + ], + 'Expected output of collapsing 1:M with empty root selection', +); + sub cmp_structures { my ($left, $right, $msg) = @_;