X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F90join_torture.t;h=8ba193e5ef5aa34897a83987c7a2a86faabe954c;hb=d56e05c74844b8b22f4f66e378b6ef992045a7b5;hp=0692c3a71a0416296e3d853ebb261239e8e7e87f;hpb=fe0708a2d68b5d34b6bc6f7e70164c3e569f1dd0;p=dbsrgits%2FDBIx-Class.git diff --git a/t/90join_torture.t b/t/90join_torture.t index 0692c3a..8ba193e 100644 --- a/t/90join_torture.t +++ b/t/90join_torture.t @@ -1,12 +1,13 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; + +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); lives_ok (sub { @@ -50,11 +51,12 @@ lives_ok (sub { ON producer_2.producerid = cd_to_producer_2.producer JOIN artist artist ON artist.artistid = me.artist WHERE ( ( producer.name = ? AND producer_2.name = ? ) ) - ORDER BY cd_to_producer.cd, producer_to_cd.producer )', [ - [ 'producer.name' => 'blah' ], - [ 'producer_2.name' => 'foo' ], + [ { sqlt_datatype => 'varchar', dbic_colname => 'producer.name', sqlt_size => 100 } + => 'blah' ], + [ { sqlt_datatype => 'varchar', dbic_colname => 'producer_2.name', sqlt_size => 100 } + => 'foo' ], ], ); @@ -77,7 +79,9 @@ cmp_ok(scalar($rs3->all), '==', 15, "All cds for artist returned"); cmp_ok($rs3->count, '==', 15, "All cds for artist returned via count"); -my $rs4 = $schema->resultset("CD")->search({ 'artist.artistid' => '1' }, { join => ['tracks', 'artist'], prefetch => 'artist' }); +my $rs4 = $schema->resultset("CD")->search({ 'artist.artistid' => '1' }, { + join => ['tracks', 'artist'], prefetch => 'artist', order_by => 'me.cdid' +}); my @rs4_results = $rs4->all; is($rs4_results[0]->cdid, 1, "correct artist returned");