X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest.pm;h=852d07a6eabf534c6da35658b398dbbb43c06719;hb=ab7e74aa35788fa25e0e98245917c7f9f5e9318c;hp=d1d53c59057d356e365814f410a69fbb040f8f53;hpb=ab340f7f379ff7c39908a01e82ca337009275eb1;p=dbsrgits%2FDBIx-Class.git diff --git a/t/lib/DBICTest.pm b/t/lib/DBICTest.pm index d1d53c5..852d07a 100644 --- a/t/lib/DBICTest.pm +++ b/t/lib/DBICTest.pm @@ -75,7 +75,7 @@ sub _database { my $dbuser = $ENV{"DBICTEST_DBUSER"} || ''; my $dbpass = $ENV{"DBICTEST_DBPASS"} || ''; - my @connect_info = ($dsn, $dbuser, $dbpass, { AutoCommit => 1 }); + my @connect_info = ($dsn, $dbuser, $dbpass, { AutoCommit => 1, %args }); return @connect_info; } @@ -135,7 +135,7 @@ sub deploy_schema { close IN; for my $chunk ( split (/;\s*\n+/, $sql) ) { if ( $chunk =~ / ^ (?! --\s* ) \S /xm ) { # there is some real sql in the chunk - a non-space at the start of the string which is not a comment - $schema->storage->dbh->do($chunk) or print "Error on SQL: $chunk\n"; + $schema->storage->dbh_do(sub { $_[1]->do($chunk) }) or print "Error on SQL: $chunk\n"; } } } @@ -155,6 +155,11 @@ sub populate_schema { my $self = shift; my $schema = shift; + $schema->populate('Genre', [ + [qw/genreid name/], + [qw/1 emo /], + ]); + $schema->populate('Artist', [ [ qw/artistid name/ ], [ 1, 'Caterwauler McCrae' ], @@ -163,8 +168,8 @@ sub populate_schema { ]); $schema->populate('CD', [ - [ qw/cdid artist title year/ ], - [ 1, 1, "Spoonful of bees", 1999 ], + [ qw/cdid artist title year genreid/ ], + [ 1, 1, "Spoonful of bees", 1999, 1 ], [ 2, 1, "Forkful of bees", 2001 ], [ 3, 1, "Caterwaulin' Blues", 1997 ], [ 4, 2, "Generic Manufactured Singles", 2001 ], @@ -243,7 +248,7 @@ sub populate_schema { $schema->populate('TreeLike', [ [ qw/id parent name/ ], - [ 1, undef, 'root' ], + [ 1, undef, 'root' ], [ 2, 1, 'foo' ], [ 3, 2, 'bar' ], [ 6, 2, 'blop' ], @@ -310,7 +315,7 @@ sub populate_schema { ]); $schema->populate('Owners', [ - [ qw/ownerid name/ ], + [ qw/id name/ ], [ 1, "Newton" ], [ 2, "Waltham" ], ]);