Introduce GOVERNANCE document and empty RESOLUTIONS file.
[dbsrgits/DBIx-Class.git] / t / storage / disable_sth_caching.t
1 BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
3 use strict;
4 use warnings;
5
6 BEGIN { $ENV{DBICTEST_VIA_REPLICATED} = 0 }
7
8 use Test::More;
9
10 use DBICTest;
11
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 ##!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
17
18 # Set up the "usual" sqlite for DBICTest
19 my $schema = DBICTest->init_schema;
20 my $dbh = $schema->storage->_get_dbh;
21
22 my $sth_one = $schema->storage->_prepare_sth($dbh, 'SELECT 42');
23 my $sth_two = $schema->storage->_prepare_sth($dbh, 'SELECT 42');
24 $schema->storage->disable_sth_caching(1);
25 my $sth_three = $schema->storage->_prepare_sth($dbh, 'SELECT 42');
26
27 ok($sth_one == $sth_two, "statement caching works");
28 ok($sth_two != $sth_three, "disabling statement caching works");
29
30 done_testing;