Introduce GOVERNANCE document and empty RESOLUTIONS file.
[dbsrgits/DBIx-Class.git] / t / prefetch / attrs_untouched.t
1 BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
3 use warnings;
4 use strict;
5
6 use Test::More;
7
8 use DBICTest;
9 use DBIx::Class::_Util 'dump_value';
10
11 my $schema = DBICTest->init_schema();
12
13 plan tests => 3;
14
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 = dump_value $search;
21 my $attr_str = dump_value $attr;
22
23 my $rs = $schema->resultset("CD")->search($search, $attr);
24
25 is( dump_value $search, $search_str, 'Search hash untouched after search()');
26 is( dump_value $attr, $attr_str, 'Attribute hash untouched after search()');
27 cmp_ok($rs + 0, '==', 3, 'Correct number of records returned');