From 49068e15377b8610f18900db0b91f875ea946ff8 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 8 Feb 2024 11:52:09 +0000 Subject: [PATCH] Bug 35248: Add tests for Koha::Booking->_assign_item_for_booking Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer --- t/db_dependent/Koha/Booking.t | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha/Booking.t b/t/db_dependent/Koha/Booking.t index 77f4006920..9a0a98a55c 100755 --- a/t/db_dependent/Koha/Booking.t +++ b/t/db_dependent/Koha/Booking.t @@ -100,7 +100,7 @@ subtest 'Relation accessor tests' => sub { }; subtest 'store() tests' => sub { - plan tests => 12; + plan tests => 13; $schema->storage->txn_begin; my $patron = $builder->build_object( { class => "Koha::Patrons" } ); @@ -279,5 +279,15 @@ subtest 'store() tests' => sub { ok( $booking->in_storage, 'Booking stored OK when item not specified and the booking slot is available' ); ok( $booking->item_id, 'An item was assigned to the booking' ); + subtest '_assign_item_for_booking() tests' => sub { + plan tests => 1; + is( $booking->item_id, $item_1->itemnumber, "Item 1 was assigned to the booking" ); + + # Bookings + # ✓ Item 1 |----| + # ✓ Item 2 |--| + # ✓ Any (1) |--| + }; + $schema->storage->txn_rollback; }; -- 2.39.5