Merge 'trunk' into 'DBIx-Class-current'
[dbsrgits/DBIx-Class-Historic.git] / t / 05components.t
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5 use Test::More;
6
7 use lib qw(t/lib);
8 use DBICTest::ForeignComponent;
9
10 plan tests => 2;
11
12 #   Tests if foreign component was loaded by calling foreign's method
13 ok( DBICTest::ForeignComponent->foreign_test_method, 'foreign component' );
14
15 #   Test for inject_base to filter out duplicates
16 {   package DBICTest::_InjectBaseTest;
17     use base qw/ DBIx::Class /;
18 }
19 DBICTest::_InjectBaseTest->inject_base( 'DBICTest::_InjectBaseTest', qw/
20     DBICTest::_InjectBaseTest::A
21     DBICTest::_InjectBaseTest::B
22     DBICTest::_InjectBaseTest::B
23     DBICTest::_InjectBaseTest::C
24 /);
25 is_deeply( \@DBICTest::_InjectBaseTest::ISA,
26     [qw/
27         DBICTest::_InjectBaseTest::A
28         DBICTest::_InjectBaseTest::B
29         DBICTest::_InjectBaseTest::C
30         DBIx::Class
31     /],
32     'inject_base filters duplicates'
33 );