X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fstorage%2Fon_connect_do.t;h=28a7e3ab8807e56f69437f54b5ca9d5a9185ad01;hb=HEAD;hp=2874a9ddb8ebe30fcd35701ce65391265e5da1dc;hpb=8d6b1478d8fa6f7c76e313ee72a72d5eb4c24d03;p=dbsrgits%2FDBIx-Class.git diff --git a/t/storage/on_connect_do.t b/t/storage/on_connect_do.t index 2874a9d..28a7e3a 100644 --- a/t/storage/on_connect_do.t +++ b/t/storage/on_connect_do.t @@ -1,6 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + 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; @@ -8,7 +12,7 @@ use Test::More tests => 13; use Test::Warn; use Test::Exception; -use lib qw(t/lib); + use DBICTest; require DBI; @@ -36,6 +40,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 ],