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>
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();
plan tests => 4;
+ my $dbh = C4::Context->dbh;
## Connection fail tests
$desired_connection_result = 'error';
warning_is {
return;
}
-$dbh->rollback;
+$schema->storage->txn_rollback;
1;