Introduce GOVERNANCE document and empty RESOLUTIONS file.
[dbsrgits/DBIx-Class.git] / xt / extra / diagnostics / deprecated_rs_attributes.t
CommitLineData
c0329273 1BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
11343b34 3use strict;
4use warnings;
5
6use Test::More;
7use Test::Warn;
c0329273 8
11343b34 9use DBICTest;
10
11my $schema = DBICTest->init_schema();
12
fb88ca2c 13my $cd_rs = $schema->resultset("CD")->search({ 'me.cdid' => 1 });
11343b34 14
15warnings_exist( sub {
02ddfe6e 16 my $cd = $cd_rs->search( undef, {
17 cols => [ { name => 'artist.name' } ],
18 join => 'artist',
19 })->next;
20
21 is_deeply (
22 { $cd->get_inflated_columns },
23 { name => 'Caterwauler McCrae' },
24 'cols attribute still works',
25 );
11343b34 26}, qr/Resultset attribute 'cols' is deprecated/,
27'deprecation warning when passing cols attribute');
28
29warnings_exist( sub {
02ddfe6e 30 my $cd = $cd_rs->search_rs( undef, {
31 include_columns => [ { name => 'artist.name' } ],
32 join => 'artist',
33 })->next;
34
35 is (
36 $cd->get_column('name'),
37 'Caterwauler McCrae',
38 'include_columns attribute still works',
39 );
11343b34 40}, qr/Resultset attribute 'include_columns' is deprecated/,
41'deprecation warning when passing include_columns attribute');
42
43done_testing;