use warnings;
use Test::More;
+use Test::Exception;
use lib qw(t/lib);
use DBICTest;
use DBI::Const::GetInfoType;
plan skip_all => 'Set $ENV{DBICTEST_MYSQL_DSN}, _USER and _PASS to run this test'
unless ($dsn && $user);
-plan tests => 10;
+plan tests => 11;
my $schema = DBICTest::Schema->connect($dsn, $user, $pass);
$dbh->do("CREATE TABLE artist (artistid INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), rank INTEGER NOT NULL DEFAULT '13', charfield CHAR(10));");
+$dbh->do("DROP TABLE IF EXISTS cd;");
+
+$dbh->do("CREATE TABLE cd (cdid INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, artist INTEGER, title TEXT, year INTEGER, genreid INTEGER, single_track INTEGER);");
+
+$dbh->do("DROP TABLE IF EXISTS producer;");
+
+$dbh->do("CREATE TABLE producer (producerid INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, name TEXT);");
+
+$dbh->do("DROP TABLE IF EXISTS cd_to_producer;");
+
+$dbh->do("CREATE TABLE cd_to_producer (cd INTEGER,producer INTEGER);");
+
#'dbi:mysql:host=localhost;database=dbic_test', 'dbic_test', '');
# This is in Core now, but it's here just to test that it doesn't break
=> 'Nothing Found!';
}
+my $cd = $schema->resultset ('CD')->create ({});
+
+my $producer = $schema->resultset ('Producer')->create ({});
+
+lives_ok { $cd->set_producers ([ $cd ]) } 'set_relationship doesnt die';
# clean up our mess
END {
#$dbh->do("DROP TABLE artist") if $dbh;
-}
\ No newline at end of file
+}