Commit | Line | Data |
b33697ef |
1 | use strict; |
f54428ab |
2 | use warnings; |
b33697ef |
3 | |
8b60b921 |
4 | BEGIN { $ENV{DBICTEST_VIA_REPLICATED} = 0 } |
5 | |
b33697ef |
6 | use Test::More; |
7 | use lib qw(t/lib); |
8 | use DBICTest; |
9 | |
9930caaf |
10 | ##!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
11 | ## This test uses undocumented internal methods |
12 | ## DO NOT USE THEM IN THE SAME MANNER |
13 | ## They are subject to ongoing change |
14 | ##!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
b33697ef |
15 | |
16 | # Set up the "usual" sqlite for DBICTest |
17 | my $schema = DBICTest->init_schema; |
9930caaf |
18 | my $dbh = $schema->storage->_get_dbh; |
b33697ef |
19 | |
9930caaf |
20 | my $sth_one = $schema->storage->_prepare_sth($dbh, 'SELECT 42'); |
21 | my $sth_two = $schema->storage->_prepare_sth($dbh, 'SELECT 42'); |
b33697ef |
22 | $schema->storage->disable_sth_caching(1); |
9930caaf |
23 | my $sth_three = $schema->storage->_prepare_sth($dbh, 'SELECT 42'); |
b33697ef |
24 | |
25 | ok($sth_one == $sth_two, "statement caching works"); |
26 | ok($sth_two != $sth_three, "disabling statement caching works"); |
9930caaf |
27 | |
28 | done_testing; |