X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F69update.t;h=46868760efa829347a517dff89d600dfe82bfb5e;hb=6f8af42b9b952d3ad7c1f1475620bab15a46bfb2;hp=70d70382357ce2c7dc0c8e19940dd9c22732c7d3;hpb=d6915f449e2d68ac184d6bc616043fd605913757;p=dbsrgits%2FDBIx-Class.git diff --git a/t/69update.t b/t/69update.t index 70d7038..4686876 100644 --- a/t/69update.t +++ b/t/69update.t @@ -5,11 +5,11 @@ use Test::More; use lib qw(t/lib); use DBICTest; -my $schema = DBICTest::init_schema(); +my $schema = DBICTest->init_schema(); BEGIN { eval "use DBD::SQLite"; - plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 3); + plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 6); } my $art = $schema->resultset("Artist")->find(1); @@ -27,3 +27,10 @@ ok($art->name($name) eq $name, 'update'); $art->discard_changes; +ok($art->update({ artistid => 100 }), 'update allows pk mutation'); + +is($art->artistid, 100, 'pk mutation applied'); + +my $art_100 = $schema->resultset("Artist")->find(100); +$art_100->artistid(101); +ok($art_100->update(), 'update allows pk mutation via column accessor');