Commit | Line | Data |
c0329273 |
1 | BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } |
2 | |
11343b34 |
3 | use strict; |
4 | use warnings; |
5 | |
6 | use Test::More; |
7 | use Test::Warn; |
c0329273 |
8 | |
11343b34 |
9 | use DBICTest; |
10 | |
11 | my $schema = DBICTest->init_schema(); |
12 | |
fb88ca2c |
13 | my $cd_rs = $schema->resultset("CD")->search({ 'me.cdid' => 1 }); |
11343b34 |
14 | |
15 | warnings_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 | |
29 | warnings_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 | |
43 | done_testing; |