@@ -, +, @@ --------- -- Are the additions/subtractions similar to http://paste.lisp.org/display/149194? --- t/db_dependent/Circulation.t | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) --- a/t/db_dependent/Circulation.t +++ a/t/db_dependent/Circulation.t @@ -34,10 +34,12 @@ BEGIN { } my $dbh = C4::Context->dbh; -my $schema = Koha::Database->new()->schema(); +my $database = Koha::Database->new(); +my $schema = $database->schema(); + # Start transaction -$dbh->{AutoCommit} = 0; +$schema->storage->txn_begin(); $dbh->{RaiseError} = 1; # Start with a clean slate @@ -302,7 +304,7 @@ C4::Context->dbh->do("DELETE FROM accountlines"); is( $renewokay, 1, 'Bug 11634 - Allow renewal of item with unfilled holds if other available items can fill those holds'); # Now let's add an item level hold, we should no longer be able to renew the item - my $hold = Koha::Database->new()->schema()->resultset('Reserve')->create( + my $hold = $schema->resultset('Reserve')->create( { borrowernumber => $hold_waiting_borrowernumber, biblionumber => $biblionumber, @@ -317,7 +319,7 @@ C4::Context->dbh->do("DELETE FROM accountlines"); # Now let's add a waiting hold on the 3rd item, it's no longer available tp check out by just anyone, so we should no longer # be able to renew these items - $hold = Koha::Database->new()->schema()->resultset('Reserve')->create( + $hold = $schema->resultset('Reserve')->create( { borrowernumber => $hold_waiting_borrowernumber, biblionumber => $biblionumber, @@ -594,6 +596,6 @@ C4::Context->dbh->do("DELETE FROM accountlines"); is ( $count, 0, "Calling UpdateFine on non-existant fine with an amount of 0 does not result in an empty fine" ); } -$dbh->rollback; +$schema->storage->txn_rollback(); 1; --