7 use Storable qw(dclone freeze thaw);
9 my $schema = DBICTest->init_schema();
12 dclone => sub { return dclone($_[0]) },
13 "freeze/thaw" => sub { return thaw(freeze($_[0])) },
16 plan tests => (5 * keys %stores);
18 for my $name (keys %stores) {
19 my $store = $stores{$name};
21 my $artist = $schema->resultset('Artist')->find(1);
22 my $copy = eval { $store->($artist) };
23 is_deeply($copy, $artist, "serialize row object works: $name");
25 # Test that an object with a related_resultset can be serialized.
26 my @cds = $artist->related_resultset("cds");
27 ok $artist->{related_resultsets}, 'has key: related_resultsets';
29 $copy = eval { $store->($artist) };
30 for my $key (keys %$artist) {
31 next if $key eq 'related_resultsets';
32 next if $key eq '_inflated_column';
33 is_deeply($copy->{$key}, $artist->{$key},
34 qq[serialize with related_resultset "$key"]);