From 6a2b76e3d49b48314c48fea64687cee4edaa1c54 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 --- 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 77f40069201..9a0a98a55c4 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.43.0