Introduce GOVERNANCE document and empty RESOLUTIONS file.
[dbsrgits/DBIx-Class.git] / xt / extra / diagnostics / invalid_resolve_relationship_condition_arguments.t
1 BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
3 use strict;
4 use warnings;
5
6 use Test::More;
7 use Test::Exception;
8
9 use DBICTest;
10
11 my $schema = DBICTest->init_schema( no_deploy => 1 );
12
13 for (
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 {
20     $schema->source('Track')->resolve_relationship_condition(
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       |
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
32   /x;
33 }
34
35 done_testing;