X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F746mssql.t;h=e5be28ac23d89bff93bafcc6c89012e5b30b0b07;hb=7b1b2582a2f787fcacd238f1635fbce4cb9e0985;hp=fa8f137d6a6e9be8f9896bff765607b1a62b2c59;hpb=5a77aa8ba52c50bdc4291ca22433f9c315234ad2;p=dbsrgits%2FDBIx-Class.git diff --git a/t/746mssql.t b/t/746mssql.t index fa8f137..e5be28a 100644 --- a/t/746mssql.t +++ b/t/746mssql.t @@ -12,7 +12,7 @@ my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_MSSQL_ODBC_${_}" } qw/DSN USER PA plan skip_all => 'Set $ENV{DBICTEST_MSSQL_ODBC_DSN}, _USER and _PASS to run this test' unless ($dsn && $user); -plan tests => 33; +plan tests => 34; my $schema = DBICTest::Schema->connect($dsn, $user, $pass); @@ -48,12 +48,22 @@ SQL my %seen_id; -# fresh $schema so we start unconnected -$schema = DBICTest::Schema->connect($dsn, $user, $pass); +my @opts = ( + { on_connect_call => 'use_dynamic_cursors' }, + {}, +); +my $new; -# test primary key handling -my $new = $schema->resultset('Artist')->create({ name => 'foo' }); -ok($new->artistid > 0, "Auto-PK worked"); +# test Auto-PK with different options +for my $opts (@opts) { + $schema = DBICTest::Schema->clone; + $schema->connection($dsn, $user, $pass, $opts); + + $schema->resultset('Artist')->search({ name => 'foo' })->delete; + + $new = $schema->resultset('Artist')->create({ name => 'foo' }); + ok($new->artistid > 0, "Auto-PK worked"); +} $seen_id{$new->artistid}++;