X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F74mssql.t;h=a882e99f1d3abfc6f9e6a0c2866bb967fe2bb03b;hb=760545facb544a496539955fcc4ed5dd91faba91;hp=02e19504db8a871054cf076aa5de02b80b184e44;hpb=1a789a7270a3d1e0fe3129960aafe8ba389d035e;p=dbsrgits%2FDBIx-Class.git diff --git a/t/74mssql.t b/t/74mssql.t index 02e1950..a882e99 100644 --- a/t/74mssql.t +++ b/t/74mssql.t @@ -31,13 +31,18 @@ for my $storage_type (@storage_types) { $schema = DBICTest::Schema->clone; - if ($storage_idx != 0) { # autodetect - $schema->storage_type("::$storage_type"); - } - $schema->connection($dsn, $user, $pass); - $schema->storage->ensure_connected; + if ($storage_idx != 0) { # autodetect + no warnings 'redefine'; + local *DBIx::Class::Storage::DBI::_typeless_placeholders_supported = + sub { 0 }; +# $schema->storage_type("::$storage_type"); + $schema->storage->ensure_connected; + } + else { + $schema->storage->ensure_connected; + } if ($storage_idx == 0 && ref($schema->storage) =~ /NoBindVars\z/) { my $tb = Test::More->builder; @@ -47,13 +52,14 @@ for my $storage_type (@storage_types) { isa_ok($schema->storage, "DBIx::Class::Storage::$storage_type"); -# start disconnected to test reconnection +# start disconnected to test _ping $schema->storage->_dbh->disconnect; - my $dbh; - lives_ok (sub { - $dbh = $schema->storage->dbh; - }, 'reconnect works'); + lives_ok { + $schema->storage->dbh_do(sub { $_[1]->do('select 1') }) + } '_ping works'; + + my $dbh = $schema->storage->dbh; $dbh->do("IF OBJECT_ID('artist', 'U') IS NOT NULL DROP TABLE artist");