Merge 'trunk' into 'DBIx-Class-current'
[dbsrgits/DBIx-Class-Historic.git] / t / run / 10auto.tl
CommitLineData
0567538f 1sub run_tests {
1edaf6fe 2my $schema = shift;
0567538f 3
2f6e5af9 4plan tests => 2;
0567538f 5
0a8462d4 6$schema->class("Artist")->load_components(qw/PK::Auto::SQLite/);
7 # Should just be PK::Auto but this ensures the compat shim works
0567538f 8
9# add an artist without primary key to test Auto
f9db5527 10my $artist = $schema->resultset("Artist")->create( { name => 'Auto' } );
0567538f 11$artist->name( 'Auto Change' );
12ok($artist->update, 'update on object created without PK ok');
13
2f6e5af9 14my $copied = $artist->copy({ name => 'Don\'t tell the RIAA', artistid => undef });
15is($copied->name, 'Don\'t tell the RIAA', "Copied with PKs ok.");
16
0567538f 17}
18
191;