X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fstorage%2Fon_connect_do.t;h=6fccbb1ae30fe886d5beed202205018e5d4e93e2;hb=7ccdd740ce900068d1c8e67f0a34ae343256bcc8;hp=2ce77b2db4413924b483ef6e27958e52af0c4462;hpb=6c925c721b4fefc6f8e3b3c2ad82c7f3efa268a3;p=dbsrgits%2FDBIx-Class.git diff --git a/t/storage/on_connect_do.t b/t/storage/on_connect_do.t index 2ce77b2..6fccbb1 100644 --- a/t/storage/on_connect_do.t +++ b/t/storage/on_connect_do.t @@ -1,6 +1,8 @@ use strict; use warnings; +BEGIN { $ENV{DBICTEST_VIA_REPLICATED} = 0 } + # !!! do not replace this with done_testing - tests reside in the callbacks # !!! number of calls is important use Test::More tests => 13; @@ -9,7 +11,7 @@ use Test::Warn; use Test::Exception; use lib qw(t/lib); -use base 'DBICTest'; +use DBICTest; require DBI; @@ -36,6 +38,11 @@ $schema->storage->disconnect; ok $schema->connection( sub { DBI->connect(DBICTest->_database, undef, undef, { AutoCommit => 0 }) }, { + # DO NOT REMOVE - this seems like an unrelated piece of info, + # but is in fact a test for a bug where setting an accessor-via-option + # would trigger an early connect *bypassing* the on_connect_* pieces + cursor_class => 'DBIx::Class::Storage::Cursor', + on_connect_do => [ 'CREATE TABLE TEST_empty (id INTEGER)', [ 'INSERT INTO TEST_empty VALUES (?)', {}, 2 ], @@ -77,6 +84,7 @@ $schema->storage->disconnect(); ok $disconnected, 'on_disconnect_do() called after disconnect()'; isa_ok($cb_args[0], 'DBIx::Class::Storage', 'first arg to on_connect_do hook'); +@cb_args = (); sub check_exists { my $storage = shift;