X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Frelationship%2Fcustom.t;h=060bb381c3cc7a6734fde663730e149b0f33532a;hb=93508f48904821b475a06d9d2652ff6e8dd0cb98;hp=c136224bb821c01aa132636c0c5fedbc5f8cda50;hpb=a4812caaab21149be7c3c65ad6c0388046430130;p=dbsrgits%2FDBIx-Class.git diff --git a/t/relationship/custom.t b/t/relationship/custom.t index c136224..060bb38 100644 --- a/t/relationship/custom.t +++ b/t/relationship/custom.t @@ -86,6 +86,39 @@ is_same_sql_bind( ], ] ); + +# re-test with ::-containing moniker name +# (we don't have any currently, so fudge it with lots of local() ) +{ + local $schema->source('Artist')->{source_name} = 'Ar::Tist'; + local $artist2->{related_resultsets}; + + is_same_sql_bind( + $artist2->cds_90s->as_query, + '( + SELECT me.cdid, me.artist, me.title, me.year, me.genreid, me.single_track + FROM artist ar_tist__row + JOIN cd me + ON ( me.artist = ar_tist__row.artistid AND ( me.year < ? AND me.year > ? ) ) + WHERE ( ar_tist__row.artistid = ? ) + )', + [ + [ + { sqlt_datatype => 'varchar', sqlt_size => 100, dbic_colname => 'me.year' } + => 2000 + ], + [ + { sqlt_datatype => 'varchar', sqlt_size => 100, dbic_colname => 'me.year' } + => 1989 + ], + [ { sqlt_datatype => 'integer', dbic_colname => 'ar_tist__row.artistid' } + => 22 + ], + ] + ); +} + + my @cds_90s = $cds_90s_rs->all; is(@cds_90s, 6, '6 90s cds found (1990 - 1995) even with non-optimized search'); map { ok($_->year < 2000 && $_->year > 1989) } @cds_90s;