Merge the relationship resolution rework
[dbsrgits/DBIx-Class.git] / xt / extra / diagnostics / add_invalid_relationship.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 {
12   local $TODO = "relationship checking needs fixing";
13   # try to add a bogus relationship using the wrong cols
14   throws_ok {
15       DBICTest::Schema::Artist->add_relationship(
16           tracks => 'DBICTest::Schema::Track',
17           { 'foreign.cd' => 'self.cdid' }
18       );
19   } qr/Unknown column/, 'failed when creating a rel with invalid key, ok';
20 }
21
22 # another bogus relationship using no join condition
23 throws_ok {
24     DBICTest::Schema::Artist->add_relationship( tracks => 'DBICTest::Track' );
25 } qr/join condition/, 'failed when creating a rel without join condition, ok';
26
27
28 done_testing;