Commit | Line | Data |
b9537280 |
1 | use strict; |
2 | use warnings; |
3 | |
fccc2e87 |
4 | use Test::More tests => 3; |
b9537280 |
5 | use lib qw(t/lib); |
6 | use DBICTest; |
7 | use DBICTest::Schema; |
8 | use DBICTest::Schema::Artist; |
9 | |
10 | DBICTest::Schema::Artist->source_name('MyArtist'); |
fccc2e87 |
11 | { |
12 | my $w; |
13 | local $SIG{__WARN__} = sub { $w = shift }; |
14 | DBICTest::Schema->register_class('FooA', 'DBICTest::Schema::Artist'); |
15 | like ($w, qr/use register_extra_source/, 'Complain about using register_class on an already-registered class'); |
16 | } |
b9537280 |
17 | |
18 | my $schema = DBICTest->init_schema(); |
19 | |
20 | my $a = $schema->resultset('FooA')->search; |
21 | is($a->count, 3, 'have 3 artists'); |
22 | is($schema->class('FooA'), 'DBICTest::FooA', 'Correct artist class'); |
fccc2e87 |
23 | |
24 | # clean up |
25 | DBICTest::Schema->_unregister_source('FooA'); |