8 my $schema = DBICTest->init_schema();
13 my $cd_rc = $schema->resultset("CD")->result_class;
15 my $artist_rs = $schema->resultset("Artist")
16 ->search_rs({}, {result_class => "IWillExplode"});
17 is($artist_rs->result_class, 'IWillExplode', 'Correct artist result_class');
19 my $cd_rs = $artist_rs->related_resultset('cds');
20 is($cd_rs->result_class, $cd_rc, 'Correct cd result_class');
22 my $cd_rs2 = $schema->resultset("Artist")->search_rs({})->related_resultset('cds');
23 is($cd_rs->result_class, $cd_rc, 'Correct cd2 result_class');
25 my $cd_rs3 = $schema->resultset("Artist")->search_rs({},{})->related_resultset('cds');
26 is($cd_rs->result_class, $cd_rc, 'Correct cd3 result_class');
28 isa_ok(eval{ $cd_rs->find(1) }, $cd_rc, 'Inflated into correct cd result_class');
33 my $cd_rc = $schema->resultset("CD")->result_class;
35 my $artist_rs = $schema->resultset("Artist")
36 ->search_rs({}, {result_class => "IWillExplode"})->search({artistid => 1});
37 is($artist_rs->result_class, 'IWillExplode', 'Correct artist result_class');
39 my $cd_rs = $artist_rs->related_resultset('cds');
40 is($cd_rs->result_class, $cd_rc, 'Correct cd result_class');
42 isa_ok(eval{ $cd_rs->find(1) }, $cd_rc, 'Inflated into correct cd result_class');
43 isa_ok(eval{ $cd_rs->search({ cdid => 1 })->first }, $cd_rc, 'Inflated into correct cd result_class');