X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fresultset%2Finflate_result_api.t;h=e09bad18e509137a094dbc30fbcf8d8aa9e1cc3c;hb=9ceb04c6a5a6de6e11009e1f58e387a77c618284;hp=6f5b0a8aaa94335f9229c994c69ffa43b2af2220;hpb=40471d469bc450ab29789724d94f4c3c825c158f;p=dbsrgits%2FDBIx-Class.git diff --git a/t/resultset/inflate_result_api.t b/t/resultset/inflate_result_api.t index 6f5b0a8..e09bad1 100644 --- a/t/resultset/inflate_result_api.t +++ b/t/resultset/inflate_result_api.t @@ -39,6 +39,7 @@ $schema->resultset('CD')->create({ title => 'Oxygene', year => 1976, artist => { name => 'JMJ' }, + artwork => {}, tracks => [ { title => 'o2', position => 2}, # the position should not be needed here, bug in MC ], @@ -469,6 +470,49 @@ INFTYPE: for ('', '(native inflator)') { ], "Expected output of collapsing 1:M with empty root selection $native_inflator", ); + + cmp_structures ( + rs_contents( $schema->resultset ('CD')->search_rs ( + { + 'tracks.title' => 'e2', + 'cds.title' => 'Oxygene', + }, + { + collapse => 1, + join => [ + 'tracks', + { single_track => { cd => 'mandatory_artwork' } }, + { artist => { cds => 'mandatory_artwork'} }, + ], + columns => { + cdid => 'cdid', + 'single_track.cd.mandatory_artwork.cd_id' => 'mandatory_artwork.cd_id', + 'artist.cds.mandatory_artwork.cd_id' => 'mandatory_artwork_2.cd_id', + }, + }, + )), + [[ + { cdid => 3 }, + { + single_track => [ + undef, + { cd => [ + undef, + { mandatory_artwork => [ { cd_id => 2 } ] } + ] } + ], + artist => [ + undef, + { cds => [ + [ + undef, + { mandatory_artwork => [ { cd_id => 2 } ] } + ] + ] }, + ], + } + ]], + ); } sub null_branch {