Add deprecation warnings for cols/include_columns
[dbsrgits/DBIx-Class.git] / t / search / deprecated_attributes.t
CommitLineData
11343b34 1use strict;
2use warnings;
3
4use Test::More;
5use Test::Warn;
6use lib qw(t/lib);
7use DBICTest;
8
9my $schema = DBICTest->init_schema();
10
11my $cd_rs = $schema->resultset("CD");
12
13warnings_exist( sub {
14 $cd_rs->search_rs( undef, { cols => [ { name => 'artist.name' } ], join => [ 'artist' ] })
15}, qr/Resultset attribute 'cols' is deprecated/,
16'deprecation warning when passing cols attribute');
17
18warnings_exist( sub {
19 $cd_rs->search_rs( undef, {
20 include_columns => [ { name => 'artist.name' } ], join => [ 'artist' ]
21 })
22}, qr/Resultset attribute 'include_columns' is deprecated/,
23'deprecation warning when passing include_columns attribute');
24
25done_testing;