From 15c6b69063c12c9a6a6e54b4f32cc7c6c1119128 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Fri, 5 Jun 2015 00:22:10 -0400 Subject: [PATCH] Bug 14334: t/db_dependent/Borrower.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? -- I added explicit rollback, since I do not know the default behaviour of DBIx. 3) run koha qa test tools --- t/db_dependent/Borrower.t | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Borrower.t b/t/db_dependent/Borrower.t index 8290cab..a17891d 100755 --- a/t/db_dependent/Borrower.t +++ b/t/db_dependent/Borrower.t @@ -30,7 +30,9 @@ BEGIN { # Start transaction 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 $categorycode = Koha::Database->new()->schema()->resultset('Category')->first()->categorycode(); @@ -71,4 +73,5 @@ $borrower = Koha::Database->new()->schema()->resultset('Borrower')->find( $borro ok( ! $borrower, "Object no longer found in database" ); is( $object->in_storage, 0, "Object is not in storage" ); +$schema->storage->txn_rollback(); 1; -- 2.1.4