apparently working additional parent support
[dbsrgits/DBIx-Class-ResultSource-MultipleTableInheritance.git] / t / 01load.t
1 use strict;
2 use warnings;
3 use lib 't/lib';
4 use Test::More qw(no_plan);
5 use Data::Dumper; $Data::Dumper::Indent = 1;
6
7 BEGIN { use_ok 'MTITest'; }
8
9 my $raw_foo = MTITest->source('Raw::Foo');
10
11 is_deeply(
12   [ $raw_foo->columns ],
13   [ qw(id a) ],
14   'Columns for raw foo ok'
15 );
16
17 my $raw_bar = MTITest->source('Raw::Bar');
18
19 is_deeply(
20   [ $raw_bar->columns ],
21   [ qw(id b) ],
22 );
23
24 ok($raw_bar->has_relationship('parent'), 'parent rel exists');
25
26 my $parent_info = $raw_bar->relationship_info('parent');
27
28 is(
29   $parent_info->{source}, 'Raw::Foo',
30   'parent rel points to raw parent'
31 );
32
33 warn Dumper $raw_bar->_columns;
34
35 warn Dumper $raw_bar->_relationships;
36
37 warn Dumper(MTITest->source('JustATable')->_relationships);