From 27f82896a2d27c2f545cbd1e7e7eea555feb610f Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Thu, 4 Jun 2015 17:03:57 -0400 Subject: [PATCH] Bug 14334: t/db_dependent/AuthoritiesMarc.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/AuthoritiesMarc.t | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/AuthoritiesMarc.t b/t/db_dependent/AuthoritiesMarc.t index f432a5d..e0d6c3b 100755 --- a/t/db_dependent/AuthoritiesMarc.t +++ b/t/db_dependent/AuthoritiesMarc.t @@ -11,6 +11,7 @@ use Test::MockModule; use Test::Warn; use MARC::Record; use t::lib::Mocks; +use Koha::Database; BEGIN { use_ok('C4::AuthoritiesMarc'); @@ -58,7 +59,9 @@ $module->mock('GetAuthority', sub { }); my $dbh = C4::Context->dbh; -$dbh->{AutoCommit} = 0; +my $database = Koha::Database->new(); +my $schema = $database->schema(); +$schema->storage->txn_begin(); $dbh->{RaiseError} = 1; t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); @@ -190,4 +193,4 @@ is_deeply( 'test BuildSummary for UNIMARC' ); -$dbh->rollback; +$schema->storage->txn_rollback(); -- 2.1.4