Institute a central "load this first in testing" package
[dbsrgits/DBIx-Class.git] / t / 70auto.t
CommitLineData
c0329273 1BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
70350518 3use strict;
8273e845 4use warnings;
70350518 5
6use Test::More;
c0329273 7
70350518 8use DBICTest;
9
a47e1233 10my $schema = DBICTest->init_schema();
0567538f 11
2f6e5af9 12plan tests => 2;
0567538f 13
0a8462d4 14$schema->class("Artist")->load_components(qw/PK::Auto::SQLite/);
15 # Should just be PK::Auto but this ensures the compat shim works
0567538f 16
17# add an artist without primary key to test Auto
f9db5527 18my $artist = $schema->resultset("Artist")->create( { name => 'Auto' } );
0567538f 19$artist->name( 'Auto Change' );
20ok($artist->update, 'update on object created without PK ok');
21
2f6e5af9 22my $copied = $artist->copy({ name => 'Don\'t tell the RIAA', artistid => undef });
23is($copied->name, 'Don\'t tell the RIAA', "Copied with PKs ok.");
24