Commit | Line | Data |
c0329273 |
1 | BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } |
2 | |
8169206c |
3 | use strict; |
4 | use warnings; |
5 | |
6 | use Test::More; |
7 | use Test::Exception; |
8 | |
8169206c |
9 | use DBICTest; |
10 | |
7293955e |
11 | my $schema = DBICTest->init_schema( no_deploy => 1 ); |
8169206c |
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 { |
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 | |
35 | done_testing; |