From: Peter Rabbitson Date: Mon, 25 Mar 2013 10:21:20 +0000 (+0100) Subject: Fix test warnings left in by 11343b34 X-Git-Tag: v0.08210~12 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=commitdiff_plain;h=02ddfe6e0a249c0805e9116f302edae02510c2b9 Fix test warnings left in by 11343b34 --- diff --git a/t/60core.t b/t/60core.t index f21355c..dc62500 100644 --- a/t/60core.t +++ b/t/60core.t @@ -173,7 +173,7 @@ is_deeply( \@cd, [qw/cdid artist title year genreid single_track/], 'column orde $cd = $schema->resultset("CD")->search({ title => 'Spoonful of bees' }, { columns => ['title'] })->next; is($cd->title, 'Spoonful of bees', 'subset of columns returned correctly'); -$cd = $schema->resultset("CD")->search(undef, { include_columns => [ { name => 'artist.name' } ], join => [ 'artist' ] })->find(1); +$cd = $schema->resultset("CD")->search(undef, { '+columns' => [ { name => 'artist.name' } ], join => [ 'artist' ] })->find(1); is($cd->title, 'Spoonful of bees', 'Correct CD returned with include'); is($cd->get_column('name'), 'Caterwauler McCrae', 'Additional column returned'); @@ -299,7 +299,9 @@ $or_rs->reset; $rel_rs->reset; my $tag = $schema->resultset('Tag')->search( - [ { 'me.tag' => 'Blue' } ], { cols=>[qw/tagid/] } )->next; + [ { 'me.tag' => 'Blue' } ], + { columns => 'tagid' } +)->next; ok($tag->has_column_loaded('tagid'), 'Has tagid loaded'); ok(!$tag->has_column_loaded('tag'), 'Has not tag loaded'); diff --git a/t/search/deprecated_attributes.t b/t/search/deprecated_attributes.t index 498c828..f4d2e28 100644 --- a/t/search/deprecated_attributes.t +++ b/t/search/deprecated_attributes.t @@ -11,14 +11,30 @@ my $schema = DBICTest->init_schema(); my $cd_rs = $schema->resultset("CD"); warnings_exist( sub { - $cd_rs->search_rs( undef, { cols => [ { name => 'artist.name' } ], join => [ 'artist' ] }) + my $cd = $cd_rs->search( undef, { + cols => [ { name => 'artist.name' } ], + join => 'artist', + })->next; + + is_deeply ( + { $cd->get_inflated_columns }, + { name => 'Caterwauler McCrae' }, + 'cols attribute still works', + ); }, qr/Resultset attribute 'cols' is deprecated/, 'deprecation warning when passing cols attribute'); warnings_exist( sub { - $cd_rs->search_rs( undef, { - include_columns => [ { name => 'artist.name' } ], join => [ 'artist' ] - }) + my $cd = $cd_rs->search_rs( undef, { + include_columns => [ { name => 'artist.name' } ], + join => 'artist', + })->next; + + is ( + $cd->get_column('name'), + 'Caterwauler McCrae', + 'include_columns attribute still works', + ); }, qr/Resultset attribute 'include_columns' is deprecated/, 'deprecation warning when passing include_columns attribute');