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 <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2016-11-16 07:44:03 +00:00 committed by Kyle M Hall
parent 0faf643661
commit fbaa28bf2a
1 changed files with 4 additions and 6 deletions

View File

@ -27,11 +27,8 @@ use C4::Context;
use Koha::Patrons;
my $dbh = C4::Context->dbh;
# Start transaction
$dbh->{AutoCommit} = 0;
$dbh->{RaiseError} = 1;
my $schema = Koha::Database->new->schema;
$schema->storage->txn_begin;
my $builder = t::lib::TestBuilder->new();
@ -118,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 {
@ -508,6 +506,6 @@ sub reload_ldap_module {
return;
}
$dbh->rollback;
$schema->storage->txn_rollback;
1;