X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=blobdiff_plain;f=xt%2Fextra%2Fdiagnostics%2Ffind_via_unsupported_rel.t;fp=xt%2Fextra%2Fdiagnostics%2Ffind_via_unsupported_rel.t;h=10328e23d85d6fb172d0c6b8b1c51299f791e5b7;hp=0000000000000000000000000000000000000000;hb=f4dc39d649672ff4452cf827ca204a1e937bc8b7;hpb=a4e4185f3c1e0af23dc3d916f706d0e92f95de45 diff --git a/xt/extra/diagnostics/find_via_unsupported_rel.t b/xt/extra/diagnostics/find_via_unsupported_rel.t new file mode 100644 index 0000000..10328e2 --- /dev/null +++ b/xt/extra/diagnostics/find_via_unsupported_rel.t @@ -0,0 +1,31 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + +use strict; +use warnings; + +use Test::More; +use Test::Exception; + +use DBICTest; + +my $schema = DBICTest->init_schema( no_deploy => 1 ); + +my $artist = $schema->resultset('Artist')->new_result({ artistid => 1 }); + +throws_ok { + $schema->resultset('ArtistUndirectedMap')->find({ + mapped_artists => $artist, + }); +} qr/\QUnable to complete value inferrence - relationship 'mapped_artists' on source 'ArtistUndirectedMap' results in expression(s) instead of definitive values: ( id1 = ? OR id2 = ? )/, + 'proper exception on OR relationship inferrence' +; + +throws_ok { + $schema->resultset('Artwork_to_Artist')->find({ + artist_limited_rank_opaque => $artist + }) +} qr/\QRelationship 'artist_limited_rank_opaque' on source 'Artwork_to_Artist' does not resolve to a 'foreign_values'-based reversed-join-free condition fragment/, + 'proper exception on ipaque custom cond' +; + +done_testing;