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