9 my $schema = DBICTest->init_schema();
10 my $storage = $schema->storage;
13 for my $disconnect (0, 1) {
14 $schema->storage->_dbh->disconnect if $disconnect;
16 $schema->storage->dbh_do(sub { $_[1]->selectall_arrayref('SELECT 1') }),
18 'dbh_do on fresh handle worked',
23 my $test_func = sub { @args = @_ };
25 $storage->dbh_do($test_func, "foo", "bar");
28 [ $storage, $storage->dbh, "foo", "bar" ],
32 my $storage_class = ref $storage;
35 local *{$storage_class .'::__test_method'} = $test_func;
36 $storage->dbh_do("__test_method", "baz", "buz");
41 [ $storage, $storage->dbh, "baz", "buz" ],
44 # test nested aliasing
46 $storage->dbh_do (sub {
47 shift->dbh_do(sub { $_[3] = 'changed' }, @_)
50 is ($res, 'changed', "Arguments properly aliased for dbh_do");