Make sure DBICTest is always loaded first (purely bookkeep)
[dbsrgits/DBIx-Class.git] / t / sqlmaker / nest_deprec.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5 use Test::Warn;
6
7 use lib qw(t/lib);
8 use DBICTest;
9 use DBIC::SqlMakerTest;
10
11 my $schema = DBICTest->init_schema();
12
13 my $sql_maker = $schema->storage->sql_maker;
14
15 # a loop so that the callsite line does not change
16 for my $expect_warn (1, 0) {
17   warnings_like (
18     sub {
19       my ($sql, @bind) = $sql_maker->select ('foo', undef, { -nest => \ 'bar' } );
20       is_same_sql_bind (
21         $sql, \@bind,
22         'SELECT * FROM foo WHERE ( bar )', [],
23         '-nest still works'
24       );
25     },
26     ($expect_warn ? qr/\Q-nest in search conditions is deprecated/ : []),
27     'Only one deprecation warning'
28   );
29 }
30
31 done_testing;