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