%{$class->result_source_instance} : (),
name => $table,
result_class => $class,
+ source_name => undef,
});
}
$class->mk_classdata('result_source_instance' => $table);
}
}
-use DBICTest::Extra; # uses Class::Inspector
+use DBICTest::ResultSetManager; # uses Class::Inspector
-my $schema = DBICTest::Extra->compose_connection('DB', 'foo');
+my $schema = DBICTest::ResultSetManager->compose_connection('DB', 'foo');
my $rs = $schema->resultset('Foo');
ok( !DB::Foo->can('bar'), 'Foo class does not have bar method' );
ok( $rs->can('bar'), 'Foo resultset class has bar method' );
-isa_ok( $rs, 'DBICTest::Extra::Foo::_resultset', 'Foo resultset class is correct' );
+isa_ok( $rs, 'DBICTest::ResultSetManager::Foo::_resultset', 'Foo resultset class is correct' );
is( $rs->bar, 'good', 'bar method works' );
my $schema = DBICTest->init_schema();
-plan tests => 61;
+plan tests => 62;
# figure out if we've got a version of sqlite that is older than 3.2.6, in
# which case COUNT(DISTINCT()) doesn't work
my @artsn = $schema->resultset('SourceNameArtists')->search({}, { order_by => 'name DESC' });
cmp_ok(@artsn, '==', 4, "Four artists returned");
+
+ # make sure subclasses that don't set source_name are ok
+ ok($schema->source('ArtistSubclass', 'ArtistSubclass exists'));
}
my $newbook = $schema->resultset( 'Bookmark' )->find(1);
package # hide from PAUSE
- DBICTest::Extra;
+ DBICTest::ResultSetManager;
use base 'DBIx::Class::Schema';
__PACKAGE__->load_classes("Foo");
package # hide from PAUSE
- DBICTest::Extra::Foo;
+ DBICTest::ResultSetManager::Foo;
use base 'DBIx::Class';
__PACKAGE__->load_components(qw/ ResultSetManager Core /);
'SelfRef',
'ArtistUndirectedMap',
'ArtistSourceName',
+ 'ArtistSubclass',
'Producer',
'CD_to_Producer',
),
--- /dev/null
+package # hide from PAUSE
+ DBICTest::Schema::ArtistSubclass;
+
+use base 'DBICTest::Schema::Artist';
+
+__PACKAGE__->table(__PACKAGE__->table);
+
+1;
\ No newline at end of file