From 1111faedddfd31dbee5139903785e2f9bc28a7f3 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 16 Nov 2016 07:44:03 +0000 Subject: [PATCH] Bug 17637: Fix tests Auth_with_ldap.t Koha::Patron->delete create a transaction and so we need to use txn_begin to have nested txn DBD::mysql::db begin_work failed: Already in a transaction Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi Signed-off-by: Mason James --- t/db_dependent/Auth_with_ldap.t | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/db_dependent/Auth_with_ldap.t b/t/db_dependent/Auth_with_ldap.t index c925c70e3d..051df96ecb 100755 --- a/t/db_dependent/Auth_with_ldap.t +++ b/t/db_dependent/Auth_with_ldap.t @@ -25,11 +25,10 @@ use Test::Warn; use C4::Context; -my $dbh = C4::Context->dbh; +use Koha::Patrons; -# Start transaction -$dbh->{AutoCommit} = 0; -$dbh->{RaiseError} = 1; +my $schema = Koha::Database->new->schema; +$schema->storage->txn_begin; my $builder = t::lib::TestBuilder->new(); @@ -116,6 +115,7 @@ subtest 'checkpw_ldap tests' => sub { plan tests => 4; + my $dbh = C4::Context->dbh; ## Connection fail tests $desired_connection_result = 'error'; warning_is { @@ -506,6 +506,6 @@ sub reload_ldap_module { return; } -$dbh->rollback; +$schema->storage->txn_rollback; 1; -- 2.39.5