1 BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
10 my $schema = DBICTest->init_schema();
12 my $art = $schema->resultset("Artist")->find(1);
14 isa_ok $art => 'DBICTest::Artist';
16 my $name = 'Caterwauler McCrae';
18 ok($art->name($name) eq $name, 'update');
21 my @changed_keys = $art->is_changed;
22 is( scalar (@changed_keys), 0, 'field changed but same value' );
25 $art->discard_changes;
27 ok($art->update({ artistid => 100 }), 'update allows pk mutation');
29 is($art->artistid, 100, 'pk mutation applied');
31 my $art_100 = $schema->resultset("Artist")->find(100);
32 $art_100->artistid(101);
33 ok($art_100->update(), 'update allows pk mutation via column accessor');