Bring back _TempExtlib (d0435d75), this time for Sub::Quote
[dbsrgits/DBIx-Class.git] / t / row / copy_with_extra_selection.t
CommitLineData
c0329273 1BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
cc506f8b 3use strict;
4use warnings;
5
6use Test::More;
7
c0329273 8
cc506f8b 9use DBICTest;
10
11my $schema = DBICTest->init_schema();
12
13my $cd = $schema->resultset('CD')->search({}, {
14 '+columns' => { avg_year => $schema->resultset('CD')->get_column('year')->func_rs('avg')->as_query },
15 order_by => 'cdid',
16})->next;
17
18my $ccd = $cd->copy({ cdid => 5_000_000, artist => 2 });
19
20cmp_ok(
21 $ccd->id,
22 '!=',
23 $cd->id,
24 'IDs differ'
25);
26
27is(
28 $ccd->title,
29 $cd->title,
30 'Title same on copied object',
31);
32
33done_testing;