8 use DBICTest::ForeignComponent;
12 # Tests if foreign component was loaded by calling foreign's method
13 ok( DBICTest::ForeignComponent->foreign_test_method, 'foreign component' );
15 # Test for inject_base to filter out duplicates
16 { package DBICTest::_InjectBaseTest;
17 use base qw/ DBIx::Class /;
18 package DBICTest::_InjectBaseTest::A;
19 package DBICTest::_InjectBaseTest::B;
20 package DBICTest::_InjectBaseTest::C;
22 DBICTest::_InjectBaseTest->inject_base( 'DBICTest::_InjectBaseTest', qw/
23 DBICTest::_InjectBaseTest::A
24 DBICTest::_InjectBaseTest::B
25 DBICTest::_InjectBaseTest::B
26 DBICTest::_InjectBaseTest::C
28 is_deeply( \@DBICTest::_InjectBaseTest::ISA,
30 DBICTest::_InjectBaseTest::A
31 DBICTest::_InjectBaseTest::B
32 DBICTest::_InjectBaseTest::C
35 'inject_base filters duplicates'
38 # Test for a warning with incorrect order in load_components
42 our @ISA = 'DBIx::Class';
44 local $SIG{__WARN__} = sub { push @warnings, shift};
45 __PACKAGE__->load_components(qw(Core UTF8Columns));
48 like( $warnings[0], qr/Core loaded before UTF8Columns/,
49 'warning issued for incorrect order in load_components()' );
50 is( scalar @warnings, 1,
51 'only one warning issued for incorrect load_components call' );
53 # Test that no warning is issued for the correct order in load_components
57 our @ISA = 'DBIx::Class';
59 local $SIG{__WARN__} = sub { push @warnings, shift };
60 __PACKAGE__->load_components(qw(UTF8Columns Core));
63 is( scalar @warnings, 0,
64 'warning not issued for correct order in load_components()' );
66 use_ok('DBIx::Class::AccessorGroup');