Institute a central "load this first in testing" package
[dbsrgits/DBIx-Class.git] / t / relationship / resolve_relationship_condition.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
10 use DBICTest;
11
12 my $schema = DBICTest->init_schema();
13
14 for (
15   { year => [1,2] },
16   { year => ['-and',1,2] },
17   { -or => [ year => 1, year => 2 ] },
18   { -and => [ year => 1, year => 2 ] },
19 ) {
20   throws_ok {
21     $schema->source('Track')->_resolve_relationship_condition(
22       rel_name => 'cd_cref_cond',
23       self_alias => 'me',
24       foreign_alias => 'cd',
25       foreign_values => $_
26     );
27   } qr/
28     \Qis not a column on related source 'CD'\E
29       |
30     \QValue supplied for '...{foreign_values}{year}' is not a direct equivalence expression\E
31   /x;
32 }
33
34 done_testing;