Merge the relationship resolution rework
[dbsrgits/DBIx-Class.git] / xt / extra / diagnostics / invalid_resolve_relationship_condition_arguments.t
CommitLineData
c0329273 1BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
8169206c 3use strict;
4use warnings;
5
6use Test::More;
7use Test::Exception;
8
8169206c 9use DBICTest;
10
7293955e 11my $schema = DBICTest->init_schema( no_deploy => 1 );
8169206c 12
13for (
14 { year => [1,2] },
15 { year => ['-and',1,2] },
16 { -or => [ year => 1, year => 2 ] },
17 { -and => [ year => 1, year => 2 ] },
18) {
19 throws_ok {
7293955e 20 $schema->source('Track')->resolve_relationship_condition(
8169206c 21 rel_name => 'cd_cref_cond',
22 self_alias => 'me',
23 foreign_alias => 'cd',
24 foreign_values => $_
25 );
26 } qr/
27 \Qis not a column on related source 'CD'\E
28 |
786c1cdd 29 \Qsupplied value for foreign column 'year' is not a direct equivalence expression\E
30 |
31 \QThe key '-\E \w+ \Q' supplied as part of 'foreign_values' during relationship resolution must be a column name, not a function\E
8169206c 32 /x;
33}
34
35done_testing;