use strict;
use warnings;
-use Test::More tests => 9;
+use Test::More tests => 10;
use lib qw(t/lib);
use base 'DBICTest';
$schema->storage->disconnect();
-my($connected, $disconnected);
+my($connected, $disconnected, @cb_args);
ok $schema->connection(
DBICTest->_database,
{
- on_connect_do => sub { $connected = 1 },
+ on_connect_do => sub { $connected = 1; @cb_args = @_; },
on_disconnect_do => sub { $disconnected = 1 },
},
), 'second connection()';
$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');
sub check_exists {
my $storage = shift;