From ce244980c3ce1a556a41e65cc723b4882019ed56 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Fri, 5 Jun 2015 01:14:34 -0400 Subject: [PATCH] Bug 14334: t/db_dependent/Branch.t AutoCommit fix There is no easy way to trigger an obvious problem. TEST PLAN --------- 1) apply patch 2) git diff origin/master -- Are the additions/subtractions similar to http://paste.lisp.org/display/149194? 3) run koha qa test tools --- t/db_dependent/Branch.t | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Branch.t b/t/db_dependent/Branch.t index 9ca3f56..3959f17 100644 --- a/t/db_dependent/Branch.t +++ b/t/db_dependent/Branch.t @@ -24,6 +24,7 @@ use Data::Dumper; use Test::More tests => 36; use C4::Branch; +use Koha::Database; BEGIN { use FindBin; @@ -56,7 +57,9 @@ can_ok( # Start transaction my $dbh = C4::Context->dbh; -$dbh->{AutoCommit} = 0; +my $database = Koha::Database->new(); +my $schema = $database->schema(); +$schema->storage->txn_begin(); $dbh->{RaiseError} = 1; # clear the slate @@ -356,5 +359,5 @@ my $loop = GetBranchesLoop; is( scalar(@$loop), GetBranchesCount(), 'There is the right number of branches' ); # End transaction -$dbh->rollback; +$schema->storage->txn_rollback(); -- 2.1.4