Commit | Line | Data |
70350518 |
1 | use strict; |
2 | use warnings; |
3 | |
4 | use Test::More; |
5 | use lib qw(t/lib); |
6 | use DBICTest; |
69ac22ee |
7 | use Storable; |
8 | |
a47e1233 |
9 | my $schema = DBICTest->init_schema(); |
69ac22ee |
10 | |
4146e3da |
11 | plan tests => 6; |
69ac22ee |
12 | |
13 | my $artist = $schema->resultset('Artist')->find(1); |
4146e3da |
14 | |
15 | { |
16 | my $copy = $schema->dclone($artist); |
17 | is_deeply($copy, $artist, "dclone row object works"); |
18 | eval { $copy->discard_changes }; |
19 | ok( !$@, "discard_changes okay" ); |
20 | is($copy->id, $artist->id, "IDs still match "); |
21 | } |
22 | |
23 | { |
24 | my $ice = $schema->freeze($artist); |
25 | my $copy = $schema->thaw($ice); |
26 | is_deeply($copy, $artist, 'dclone row object works'); |
27 | |
28 | eval { $copy->discard_changes }; |
29 | ok( !$@, "discard_changes okay" ); |
30 | is($copy->id, $artist->id, "IDs still okay"); |
31 | } |
69ac22ee |
32 | |