10 use_ok( 'DBICTest::Schema' );
12 my $schema = DBICTest->init_schema;
14 my $e_start = quotemeta('DBIx::Class::');
19 $schema->resultset('CD')->create({ title => 'vacation in antarctica' })
21 qr/$e_start.+constraint failed.+NULL/s
22 ); # as opposed to some other error
23 }, [], 'No warnings besides exception' );
25 my $dbh = $schema->storage->dbh;
29 $dbh->do ('INSERT INTO nonexistent_table VALUES (1)')
31 qr/$e_start.+DBI Exception.+no such table/,
32 'DBI exceptions properly handled by dbic-installed callback'
35 # destruction of everything except the $dbh should use the proper
39 # These explicit disconnections on loss of $storage don't seem
40 # right... disable it here for the test anyway
42 local $dbh->{Callbacks}{disconnect} = sub { 1 };
47 $dbh->do ('INSERT INTO nonexistent_table VALUES (1)')
49 qr/DBI Exception.+unhandled by DBIC.+no such table/,
50 'callback works after $schema is gone'