Run the entire test suite under replicated SQLite on DBICTEST_VIA_REPLICATED
[dbsrgits/DBIx-Class.git] / t / storage / disable_sth_caching.t
CommitLineData
b33697ef 1use strict;
f54428ab 2use warnings;
b33697ef 3
fd2c6658 4BEGIN { $ENV{DBICTEST_VIA_REPLICATED} = 0 }
5
b33697ef 6use Test::More;
7use lib qw(t/lib);
8use 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
17my $schema = DBICTest->init_schema;
9930caaf 18my $dbh = $schema->storage->_get_dbh;
b33697ef 19
9930caaf 20my $sth_one = $schema->storage->_prepare_sth($dbh, 'SELECT 42');
21my $sth_two = $schema->storage->_prepare_sth($dbh, 'SELECT 42');
b33697ef 22$schema->storage->disable_sth_caching(1);
9930caaf 23my $sth_three = $schema->storage->_prepare_sth($dbh, 'SELECT 42');
b33697ef 24
25ok($sth_one == $sth_two, "statement caching works");
26ok($sth_two != $sth_three, "disabling statement caching works");
9930caaf 27
28done_testing;