Commit | Line | Data |
c0329273 |
1 | BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } |
2 | |
867f1b28 |
3 | use strict; |
4 | use warnings; |
5 | |
6 | use Test::More; |
c0329273 |
7 | |
867f1b28 |
8 | use DBICTest; |
9 | |
10 | my $schema = DBICTest->init_schema(); |
11 | |
fb88ca2c |
12 | my $artist = $schema->resultset('Artist')->find(1); |
867f1b28 |
13 | |
14 | is_deeply( |
15 | [ $artist->id, $artist->ident_condition, $artist->_storage_ident_condition ], |
16 | [ 1, { artistid => 1 }, { artistid => 1 } ], |
17 | 'Correct identity state of freshly retrieved object', |
18 | ); |
19 | |
20 | $artist->artistid(888); |
21 | |
22 | is_deeply( |
23 | [ $artist->id, $artist->ident_condition, $artist->_storage_ident_condition ], |
24 | [ 888, { artistid => 888 }, { artistid => 1 } ], |
25 | 'Correct identity state of object with modified PK', |
26 | ); |
27 | |
28 | $artist->update; |
29 | |
30 | is_deeply( |
31 | [ $artist->id, $artist->ident_condition, $artist->_storage_ident_condition ], |
32 | [ 888, { artistid => 888 }, { artistid => 888 } ], |
33 | 'Correct identity state after storage update', |
34 | ); |
35 | |
36 | done_testing; |