Added handling for implicit inflate/deflate of CDBI has_a relationships
[dbsrgits/DBIx-Class.git] / t / 102load_classes.t
1 use strict;
2 use warnings;
3 use Test::More;
4
5 use lib 't/lib';
6 use DBICTest;
7
8 my $warnings;
9 eval {
10     local $SIG{__WARN__} = sub { $warnings .= shift };
11     package DBICTest::Schema;
12     use base qw/DBIx::Class::Schema/;
13     __PACKAGE__->load_classes;
14 };
15 ok(!$@, 'Loaded all loadable classes') or diag $@;
16 like($warnings, qr/Failed to load DBICTest::Schema::NoSuchClass. Can't find source_name method. Is DBICTest::Schema::NoSuchClass really a full DBIC result class?/, 'Warned about broken result class');
17
18 my $source_a = DBICTest::Schema->source('Artist');
19 isa_ok($source_a, 'DBIx::Class::ResultSource::Table');
20 my $rset_a   = DBICTest::Schema->resultset('Artist');
21 isa_ok($rset_a, 'DBIx::Class::ResultSet');
22
23 done_testing;