f6dca5a39dc07d8f8231be91b271f8d5330f8162
[dbsrgits/DBIx-Class.git] / t / storage / deprecated_exception_source_bind_attrs.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5 use Test::Warn;
6 use Test::Exception;
7 use lib qw(t/lib);
8 use DBICTest;
9
10 {
11   package DBICTest::Legacy::Storage;
12   use base 'DBIx::Class::Storage::DBI::SQLite';
13
14   use Data::Dumper::Concise;
15
16   sub source_bind_attributes { return {} }
17 }
18
19
20 my $schema = DBICTest::Schema->clone;
21 $schema->storage_type('DBICTest::Legacy::Storage');
22 $schema->connection('dbi:SQLite::memory:');
23
24 throws_ok
25   { $schema->storage->ensure_connected }
26   qr/\Qstorage subclass DBICTest::Legacy::Storage provides (or inherits) the method source_bind_attributes()/,
27   'deprecated use of source_bind_attributes throws',
28 ;
29
30 done_testing;