Fix tests failing due to unspecified resultset retrieval order
[dbsrgits/DBIx-Class.git] / t / update / ident_cond.t
CommitLineData
867f1b28 1use strict;
2use warnings;
3
4use Test::More;
5use lib qw(t/lib);
6use DBICTest;
7
8my $schema = DBICTest->init_schema();
9
fb88ca2c 10my $artist = $schema->resultset('Artist')->find(1);
867f1b28 11
12is_deeply(
13 [ $artist->id, $artist->ident_condition, $artist->_storage_ident_condition ],
14 [ 1, { artistid => 1 }, { artistid => 1 } ],
15 'Correct identity state of freshly retrieved object',
16);
17
18$artist->artistid(888);
19
20is_deeply(
21 [ $artist->id, $artist->ident_condition, $artist->_storage_ident_condition ],
22 [ 888, { artistid => 888 }, { artistid => 1 } ],
23 'Correct identity state of object with modified PK',
24);
25
26$artist->update;
27
28is_deeply(
29 [ $artist->id, $artist->ident_condition, $artist->_storage_ident_condition ],
30 [ 888, { artistid => 888 }, { artistid => 888 } ],
31 'Correct identity state after storage update',
32);
33
34done_testing;