Commit | Line | Data |
e9bd1473 |
1 | use warnings; |
2 | |
3 | use Test::More; |
4 | use Test::Exception; |
5 | use lib qw(t/lib); |
6 | use DBICTest; |
bfa46eb5 |
7 | |
e9bd1473 |
8 | use Data::Dumper; |
bfa46eb5 |
9 | $Data::Dumper::Sortkeys = 1; |
e9bd1473 |
10 | |
11 | my $schema = DBICTest->init_schema(); |
12 | |
f1952f5c |
13 | plan tests => 3; |
e9bd1473 |
14 | |
e9bd1473 |
15 | # bug in 0.07000 caused attr (join/prefetch) to be modifed by search |
16 | # so we check the search & attr arrays are not modified |
17 | my $search = { 'artist.name' => 'Caterwauler McCrae' }; |
18 | my $attr = { prefetch => [ qw/artist liner_notes/ ], |
19 | order_by => 'me.cdid' }; |
20 | my $search_str = Dumper($search); |
21 | my $attr_str = Dumper($attr); |
22 | |
23 | my $rs = $schema->resultset("CD")->search($search, $attr); |
24 | |
25 | is(Dumper($search), $search_str, 'Search hash untouched after search()'); |
26 | is(Dumper($attr), $attr_str, 'Attribute hash untouched after search()'); |
27 | cmp_ok($rs + 0, '==', 3, 'Correct number of records returned'); |