Merge the relationship resolution rework
[dbsrgits/DBIx-Class.git] / xt / extra / diagnostics / find_via_unsupported_rel.t
CommitLineData
cc10d685 1BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
3use strict;
4use warnings;
5
6use Test::More;
7use Test::Exception;
8
9use DBICTest;
10
11my $schema = DBICTest->init_schema( no_deploy => 1 );
12
13my $artist = $schema->resultset('Artist')->new_result({ artistid => 1 });
14
15throws_ok {
16 $schema->resultset('ArtistUndirectedMap')->find({
17 mapped_artists => $artist,
18 });
19} qr/\QUnable to complete value inferrence - relationship 'mapped_artists' on source 'ArtistUndirectedMap' results in expression(s) instead of definitive values: ( id1 = ? OR id2 = ? )/,
20 'proper exception on OR relationship inferrence'
21;
22
23throws_ok {
24 $schema->resultset('Artwork_to_Artist')->find({
25 artist_limited_rank_opaque => $artist
26 })
27} qr/\QRelationship 'artist_limited_rank_opaque' on source 'Artwork_to_Artist' does not resolve to a 'foreign_values'-based reversed-join-free condition fragment/,
28 'proper exception on ipaque custom cond'
29;
30
31done_testing;