From af2480f0e13d6ed3c09e725fed8662eac7e8ec57 Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Fri, 21 Oct 2022 11:31:09 -0400 Subject: [PATCH] Bug 31920: Add transaction to subtest in t/db_dependent/Holds.t A subest in t/db_dependent/Holds.t leaves behind database cruft. Test Plan: Using koha-testing-docker: 1) SELECT branchcode FROM branches 2) prove t/db_dependent/Holds.t 3) SELECT branchcode FROM branches Note cruft 4) reset_all 2) prove t/db_dependent/Holds.t 3) SELECT branchcode FROM branches No cruft! Signed-off-by: David Nind Signed-off-by: Katrin Fischer --- t/db_dependent/Holds.t | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t index 6f87d43533..3ed6e72f09 100755 --- a/t/db_dependent/Holds.t +++ b/t/db_dependent/Holds.t @@ -1709,6 +1709,9 @@ subtest 'ModReserve can only update expirationdate for found holds' => sub { subtest 'Koha::Holds->get_items_that_can_fill returns items with datecancelled or (inclusive) datearrived' => sub { plan tests => 8; + + $schema->storage->txn_begin; + # biblio item with date arrived and date cancelled my $biblio1 = $builder->build_sample_biblio(); my $item1 = $builder->build_sample_item({ biblionumber => $biblio1->biblionumber }); @@ -1795,4 +1798,6 @@ subtest 'Koha::Holds->get_items_that_can_fill returns items with datecancelled o is($items_that_can_fill3->count, 1, "Koha::Holds->get_items_that_can_fill returns 1 item with correct parameters"); is($items_that_can_fill4->next, undef, "Koha::Holds->get_items_that_can_fill doesn't return item with undefined datearrived and undefined datecancelled"); is($items_that_can_fill4->count, 0, "Koha::Holds->get_items_that_can_fill returns 0 item"); -} + + $schema->storage->txn_rollback; +}; -- 2.30.2