Make sure DBICTest is always loaded first (purely bookkeep)
[dbsrgits/DBIx-Class.git] / t / sqlmaker / nest_deprec.t
CommitLineData
b1d821de 1use strict;
2use warnings;
3
4use Test::More;
5use Test::Warn;
6
7use lib qw(t/lib);
5e724964 8use DBICTest;
b1d821de 9use DBIC::SqlMakerTest;
10
b1d821de 11my $schema = DBICTest->init_schema();
12
13my $sql_maker = $schema->storage->sql_maker;
14
15# a loop so that the callsite line does not change
16for 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
31done_testing;