From 42551a04fef38d26cc703cbd52cc6375c7672983 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Fri, 5 Jun 2015 00:39:04 -0400 Subject: [PATCH] Bug 14334: t/db_dependent/Borrower_Debarments.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/Borrower_Debarments.t | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Borrower_Debarments.t b/t/db_dependent/Borrower_Debarments.t index 1c1d9bf..3e1c381 100755 --- a/t/db_dependent/Borrower_Debarments.t +++ b/t/db_dependent/Borrower_Debarments.t @@ -4,13 +4,16 @@ use Modern::Perl; use C4::Context; use C4::Members; +use Koha::Database; use Test::More tests => 31; use_ok('Koha::Borrower::Debarments'); my $dbh = C4::Context->dbh; -$dbh->{AutoCommit} = 0; +my $database = Koha::Database->new(); +my $schema = $database->schema(); +$schema->storage->txn_begin(); $dbh->{RaiseError} = 1; my $borrowernumber = AddMember( @@ -154,4 +157,4 @@ is( IsDebarred( $borrowernumber ), undef, 'A patron without a debarred date is n $dbh->do(q|UPDATE borrowers SET debarred = '9999-12-31'|); # Note: Change this test before the first of January 10000! is( IsDebarred( $borrowernumber ), '9999-12-31', 'A patron with a debarred date in the future is debarred' ); -$dbh->rollback; +$schema->storage->txn_rollback(); -- 2.1.4