Adding 'RETURNING *' to each body_part.
[dbsrgits/DBIx-Class-ResultSource-MultipleTableInheritance.git] / t / 01load.t
CommitLineData
7abe3af2 1use strict;
2use warnings;
3use lib 't/lib';
4use Test::More qw(no_plan);
7abe3af2 5
6BEGIN { use_ok 'MTITest'; }
7
7abe3af2 8my $raw_foo = MTITest->source('Raw::Foo');
9
10is_deeply(
11 [ $raw_foo->columns ],
12 [ qw(id a) ],
146ec120 13 'Columns for raw foo ok: id a'
7abe3af2 14);
15
4d88a8d7 16my $raw_bar = MTITest->source('Raw::Bar');
17
18is_deeply(
19 [ $raw_bar->columns ],
20 [ qw(id b) ],
146ec120 21 'Columns for raw bar ok: id b'
4d88a8d7 22);
23
24ok($raw_bar->has_relationship('parent'), 'parent rel exists');
25
26my $parent_info = $raw_bar->relationship_info('parent');
27
28is(
29 $parent_info->{source}, 'Raw::Foo',
30 'parent rel points to raw parent'
31);
32
e7189506 33my $foo = MTITest->source('Foo');
34my $bar = MTITest->source('Bar');
4d88a8d7 35
e7189506 36is_deeply(
37 [ $foo->columns ],
38 [ qw(id a) ],
39 'Columns for mti foo are still the same: id a'
40);
41
42
43is_deeply(
44 [ $bar->columns ],
45 [ qw(id a words b) ],
46 'Columns for mti bar now contain those of foo and the mixin: id a words b'
47);