X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F68inflate_resultclass_hashrefinflator.t;h=35329000de87029d853e684dc5d7940fcc2ff1d9;hb=5432c6ae1a31569775574edd42cb3e3f6f79cfff;hp=96926ea767e6cc35b581403d512f33e2bf3e446c;hpb=584e74ed9268ffeba3aba23a148cdace7b46649c;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/68inflate_resultclass_hashrefinflator.t b/t/68inflate_resultclass_hashrefinflator.t index 96926ea..3532900 100644 --- a/t/68inflate_resultclass_hashrefinflator.t +++ b/t/68inflate_resultclass_hashrefinflator.t @@ -4,7 +4,6 @@ use warnings; use Test::More qw(no_plan); use lib qw(t/lib); use DBICTest; -use DBIx::Class::ResultClass::HashRefInflator; my $schema = DBICTest->init_schema(); @@ -62,6 +61,7 @@ sub check_cols_of { $schema->resultset('CD')->create({ title => 'Silence is golden', artist => 3, year => 2006 }); # order_by to ensure both resultsets have the rows in the same order +# also check result_class-as-an-attribute syntax my $rs_dbic = $schema->resultset('CD')->search(undef, { prefetch => [ qw/ artist tracks / ], @@ -72,9 +72,9 @@ my $rs_hashrefinf = $schema->resultset('CD')->search(undef, { prefetch => [ qw/ artist tracks / ], order_by => [ 'me.cdid', 'tracks.position' ], + result_class => 'DBIx::Class::ResultClass::HashRefInflator', } ); -$rs_hashrefinf->result_class('DBIx::Class::ResultClass::HashRefInflator'); my @dbic = $rs_dbic->all; my @hashrefinf = $rs_hashrefinf->all; @@ -98,8 +98,8 @@ $rs_hashrefinf = $schema->resultset ('Artist')->search ({ 'me.artistid' => 1}, { select => [qw/name tracks.title tracks.cd /], as => [qw/name cds.tracks.title cds.tracks.cd /], order_by => [qw/cds.cdid tracks.trackid/], + result_class => 'DBIx::Class::ResultClass::HashRefInflator', }); -$rs_hashrefinf->result_class('DBIx::Class::ResultClass::HashRefInflator'); @dbic = map { $_->tracks->all } ($rs_dbic->first->cds->all); @hashrefinf = $rs_hashrefinf->all;