Bug 35248 - Bookings needs unit tests
Summary: Bookings needs unit tests
Status: Passed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Martin Renvoize
QA Contact: Testopia
URL:
Keywords: rel_24_05_candidate
Depends on: 35788
Blocks: 35906 35937 35944 35946 36120 36040
  Show dependency treegraph
 
Reported: 2023-11-03 14:00 UTC by Martin Renvoize
Modified: 2024-02-26 12:29 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 35248: Add unit test for Koha::Item->bookings relation (2.66 KB, patch)
2024-01-16 12:48 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add unit tests for Koha::Item->find_booking (6.06 KB, patch)
2024-01-16 12:48 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Unit tests for CanBookBeIssued (5.72 KB, patch)
2024-01-29 16:33 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add unit tests for Koha::Item->check_booking (4.21 KB, patch)
2024-01-29 18:35 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Drop ->place_booking (3.45 KB, patch)
2024-01-30 07:36 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add test for Koha::Exceptions::Booking (1.27 KB, patch)
2024-01-30 07:46 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Remove Koha::Booking->intersects (1.48 KB, patch)
2024-01-30 11:24 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add unit tests for Koha::Booking relations (4.22 KB, patch)
2024-01-30 13:54 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add unit test for Koha::Item->bookings relation (2.68 KB, patch)
2024-01-30 17:09 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add unit tests for Koha::Item->find_booking (6.06 KB, patch)
2024-01-30 17:09 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Unit tests for CanBookBeIssued (6.03 KB, patch)
2024-01-30 17:09 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add unit tests for Koha::Item->check_booking (4.21 KB, patch)
2024-01-30 17:09 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Drop ->place_booking (4.11 KB, patch)
2024-01-30 17:09 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add test for Koha::Exceptions::Booking (1.36 KB, patch)
2024-01-30 17:09 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Remove Koha::Booking->intersects (1.48 KB, patch)
2024-01-30 17:09 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add unit tests for Koha::Booking relations (4.22 KB, patch)
2024-01-30 17:10 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add Koha::Biblio->bookings unit test (1.76 KB, patch)
2024-01-30 17:10 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add unit tests for Koha::Bibilio->check_booking (4.05 KB, patch)
2024-01-30 17:10 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add unit test for Koha::Item->bookings relation (2.68 KB, patch)
2024-02-07 16:40 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add unit tests for Koha::Item->find_booking (6.06 KB, patch)
2024-02-07 16:40 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Unit tests for CanBookBeIssued (6.03 KB, patch)
2024-02-07 16:41 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add unit tests for Koha::Item->check_booking (4.21 KB, patch)
2024-02-07 16:41 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Drop ->place_booking (4.11 KB, patch)
2024-02-07 16:41 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add test for Koha::Exceptions::Booking (1.36 KB, patch)
2024-02-07 16:41 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Remove Koha::Booking->intersects (1.48 KB, patch)
2024-02-07 16:41 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add unit tests for Koha::Booking relations (4.22 KB, patch)
2024-02-07 16:41 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add Koha::Biblio->bookings unit test (1.76 KB, patch)
2024-02-07 16:41 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add unit tests for Koha::Bibilio->check_booking (4.05 KB, patch)
2024-02-07 16:41 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add unit tests for Koha::Bibilio->bookable_items (1.87 KB, patch)
2024-02-07 16:41 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add unit test for Koha::Item->bookings relation (2.73 KB, patch)
2024-02-07 22:52 UTC, David Nind
Details | Diff | Splinter Review
Bug 35248: Add unit tests for Koha::Item->find_booking (6.11 KB, patch)
2024-02-07 22:52 UTC, David Nind
Details | Diff | Splinter Review
Bug 35248: Unit tests for CanBookBeIssued (6.08 KB, patch)
2024-02-07 22:52 UTC, David Nind
Details | Diff | Splinter Review
Bug 35248: Add unit tests for Koha::Item->check_booking (4.26 KB, patch)
2024-02-07 22:52 UTC, David Nind
Details | Diff | Splinter Review
Bug 35248: Drop ->place_booking (3.93 KB, patch)
2024-02-07 22:52 UTC, David Nind
Details | Diff | Splinter Review
Bug 35248: Add test for Koha::Exceptions::Booking (1.40 KB, patch)
2024-02-07 22:52 UTC, David Nind
Details | Diff | Splinter Review
Bug 35248: Remove Koha::Booking->intersects (1.52 KB, patch)
2024-02-07 22:52 UTC, David Nind
Details | Diff | Splinter Review
Bug 35248: Add unit tests for Koha::Booking relations (4.26 KB, patch)
2024-02-07 22:52 UTC, David Nind
Details | Diff | Splinter Review
Bug 35248: Add Koha::Biblio->bookings unit test (1.80 KB, patch)
2024-02-07 22:52 UTC, David Nind
Details | Diff | Splinter Review
Bug 35248: Add unit tests for Koha::Bibilio->check_booking (4.09 KB, patch)
2024-02-07 22:52 UTC, David Nind
Details | Diff | Splinter Review
Bug 35248: Add unit tests for Koha::Bibilio->bookable_items (1.91 KB, patch)
2024-02-07 22:53 UTC, David Nind
Details | Diff | Splinter Review
Bug 35248: Add tests for Koha::Booking->store (8.93 KB, patch)
2024-02-08 11:54 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Refactor - Move assign_item_for_booking (4.97 KB, patch)
2024-02-08 11:54 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add tests for Koha::Booking->store (9.02 KB, patch)
2024-02-08 12:17 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Refactor - Move assign_item_for_booking (4.97 KB, patch)
2024-02-08 12:17 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add tests for Koha::Booking->_assign_item_for_booking (1.36 KB, patch)
2024-02-08 12:17 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add tests for Koha::Booking->_assign_item_for_booking (1.36 KB, patch)
2024-02-08 12:19 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Whitespace clean (10.75 KB, patch)
2024-02-08 12:23 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 35248: Add unit test for Koha::Item->bookings relation (2.78 KB, patch)
2024-02-08 13:10 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35248: Add unit tests for Koha::Item->find_booking (6.17 KB, patch)
2024-02-08 13:10 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35248: Unit tests for CanBookBeIssued (6.14 KB, patch)
2024-02-08 13:10 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35248: Add unit tests for Koha::Item->check_booking (4.31 KB, patch)
2024-02-08 13:10 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35248: Drop ->place_booking (3.99 KB, patch)
2024-02-08 13:10 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35248: Add test for Koha::Exceptions::Booking (1.46 KB, patch)
2024-02-08 13:10 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35248: Remove Koha::Booking->intersects (1.58 KB, patch)
2024-02-08 13:10 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35248: Add unit tests for Koha::Booking relations (4.32 KB, patch)
2024-02-08 13:10 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35248: Add Koha::Biblio->bookings unit test (1.86 KB, patch)
2024-02-08 13:10 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35248: Add unit tests for Koha::Bibilio->check_booking (4.15 KB, patch)
2024-02-08 13:10 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35248: Add unit tests for Koha::Bibilio->bookable_items (1.97 KB, patch)
2024-02-08 13:10 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35248: Add tests for Koha::Booking->store (9.07 KB, patch)
2024-02-08 13:10 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35248: Refactor - Move assign_item_for_booking (5.02 KB, patch)
2024-02-08 13:10 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35248: Add tests for Koha::Booking->_assign_item_for_booking (1.42 KB, patch)
2024-02-08 13:10 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35248: Whitespace clean (10.80 KB, patch)
2024-02-08 13:10 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize 2023-11-03 14:00:49 UTC
Bug 29002 adds a bookings foundation, but as the code progressed with feedback coming in the original unit tests didn't keep up.

Tomas has agreed to push it without the tests so we can continue to test more widely and can onboard more developers working on the code.. but I do need to revisit it all and write tests for all the new modules and functions.

This bug serves to store the tests as I write them.
Comment 1 Martin Renvoize 2024-01-16 12:48:19 UTC
Created attachment 161061 [details] [review]
Bug 35248: Add unit test for Koha::Item->bookings relation

This patch adds a simple unit test for the 'bookings' relation accessor
added to Koha::Item.

Test plan
1) Run t/db_dependant/Koha/Item.t
Comment 2 Martin Renvoize 2024-01-16 12:48:22 UTC
Created attachment 161062 [details] [review]
Bug 35248: Add unit tests for Koha::Item->find_booking

This patch adds basic unit tests for the Koha::Item->find_booking
method.

Test plan
1) Run t/db_dependant/Koha/Item.t
Comment 3 Martin Renvoize 2024-01-29 16:33:09 UTC
Created attachment 161608 [details] [review]
Bug 35248: Unit tests for CanBookBeIssued

Whilst writing the test, I found a minor flaw in the logic and fixed
that in CanBookBeIssued at the same time.
Comment 4 Martin Renvoize 2024-01-29 18:35:24 UTC
Created attachment 161611 [details] [review]
Bug 35248: Add unit tests for Koha::Item->check_booking

This patch adds basic unit tests for the Koha::Item->check_booking
method.

Test plan
1) Run t/db_dependant/Koha/Item.t
Comment 5 Martin Renvoize 2024-01-30 07:36:41 UTC
Created attachment 161620 [details] [review]
Bug 35248: Drop ->place_booking

These methods were introduced and used in an earlier iteration of the
code, they are no longer called from anywhere (the code in
Koha::Booking->store handles all cases instead) and thus I choose to
remove them rather than add unit tests for them.. They are simple
methods that could be re-introduced as required at a future date.
Comment 6 Martin Renvoize 2024-01-30 07:46:47 UTC
Created attachment 161621 [details] [review]
Bug 35248: Add test for Koha::Exceptions::Booking
Comment 7 Martin Renvoize 2024-01-30 11:24:08 UTC
Created attachment 161632 [details] [review]
Bug 35248: Remove Koha::Booking->intersects

Another method left behind from an earlier iteration.. not actually
called anywhere in the final submission in Koha.
Comment 8 Martin Renvoize 2024-01-30 13:54:53 UTC
Created attachment 161636 [details] [review]
Bug 35248: Add unit tests for Koha::Booking relations

This patch adds unit tests for the relations introduced in the new
Koha::Booking class.

Test plan
1) Run t/db_dependent/Koha/Booking.t
Comment 9 Martin Renvoize 2024-01-30 17:09:44 UTC
Created attachment 161651 [details] [review]
Bug 35248: Add unit test for Koha::Item->bookings relation

This patch adds a simple unit test for the 'bookings' relation accessor
added to Koha::Item.

Test plan
1) Run t/db_dependant/Koha/Item.t
Comment 10 Martin Renvoize 2024-01-30 17:09:46 UTC
Created attachment 161652 [details] [review]
Bug 35248: Add unit tests for Koha::Item->find_booking

This patch adds basic unit tests for the Koha::Item->find_booking
method.

Test plan
1) Run t/db_dependant/Koha/Item.t
Comment 11 Martin Renvoize 2024-01-30 17:09:49 UTC
Created attachment 161653 [details] [review]
Bug 35248: Unit tests for CanBookBeIssued

Whilst writing the test, I found a minor flaw in the logic and fixed
that in CanBookBeIssued at the same time.
Comment 12 Martin Renvoize 2024-01-30 17:09:51 UTC
Created attachment 161654 [details] [review]
Bug 35248: Add unit tests for Koha::Item->check_booking

This patch adds basic unit tests for the Koha::Item->check_booking
method.

Test plan
1) Run t/db_dependant/Koha/Item.t
Comment 13 Martin Renvoize 2024-01-30 17:09:54 UTC
Created attachment 161655 [details] [review]
Bug 35248: Drop ->place_booking

These methods were introduced and used in an earlier iteration of the
code, they are no longer called from anywhere (the code in
Koha::Booking->store handles all cases instead) and thus I choose to
remove them rather than add unit tests for them.. They are simple
methods that could be re-introduced as required at a future date.
Comment 14 Martin Renvoize 2024-01-30 17:09:56 UTC
Created attachment 161656 [details] [review]
Bug 35248: Add test for Koha::Exceptions::Booking
Comment 15 Martin Renvoize 2024-01-30 17:09:59 UTC
Created attachment 161657 [details] [review]
Bug 35248: Remove Koha::Booking->intersects

Another method left behind from an earlier iteration.. not actually
called anywhere in the final submission in Koha.
Comment 16 Martin Renvoize 2024-01-30 17:10:02 UTC
Created attachment 161658 [details] [review]
Bug 35248: Add unit tests for Koha::Booking relations

This patch adds unit tests for the relations introduced in the new
Koha::Booking class.

Test plan
1) Run t/db_dependent/Koha/Booking.t
Comment 17 Martin Renvoize 2024-01-30 17:10:05 UTC
Created attachment 161659 [details] [review]
Bug 35248: Add Koha::Biblio->bookings unit test

This patch adds unit tests for the bookings relationship accessor on
Koha::Biblio objects.

Test plan
1) Run t/db_dependant/Koha/Biblio.t
Comment 18 Martin Renvoize 2024-01-30 17:10:07 UTC
Created attachment 161660 [details] [review]
Bug 35248: Add unit tests for Koha::Bibilio->check_booking

This patch adds basic unit tests for Koha::Biblio->check_booking

Test plan
1) Run t/db_dependent/Koha/Biblio.t
Comment 19 Martin Renvoize 2024-02-07 16:18:28 UTC
There's still more to come here.. but I really think as people are starting to enhance and expand on bookings now we need these in sooner rather than later... setting to NSO to start getting eyes and I'll keep throwing more tests into further bugs.
Comment 20 Martin Renvoize 2024-02-07 16:40:55 UTC
Created attachment 161821 [details] [review]
Bug 35248: Add unit test for Koha::Item->bookings relation

This patch adds a simple unit test for the 'bookings' relation accessor
added to Koha::Item.

Test plan
1) Run t/db_dependant/Koha/Item.t
Comment 21 Martin Renvoize 2024-02-07 16:40:58 UTC
Created attachment 161822 [details] [review]
Bug 35248: Add unit tests for Koha::Item->find_booking

This patch adds basic unit tests for the Koha::Item->find_booking
method.

Test plan
1) Run t/db_dependant/Koha/Item.t
Comment 22 Martin Renvoize 2024-02-07 16:41:00 UTC
Created attachment 161823 [details] [review]
Bug 35248: Unit tests for CanBookBeIssued

Whilst writing the test, I found a minor flaw in the logic and fixed
that in CanBookBeIssued at the same time.
Comment 23 Martin Renvoize 2024-02-07 16:41:03 UTC
Created attachment 161824 [details] [review]
Bug 35248: Add unit tests for Koha::Item->check_booking

This patch adds basic unit tests for the Koha::Item->check_booking
method.

Test plan
1) Run t/db_dependant/Koha/Item.t
Comment 24 Martin Renvoize 2024-02-07 16:41:05 UTC
Created attachment 161825 [details] [review]
Bug 35248: Drop ->place_booking

These methods were introduced and used in an earlier iteration of the
code, they are no longer called from anywhere (the code in
Koha::Booking->store handles all cases instead) and thus I choose to
remove them rather than add unit tests for them.. They are simple
methods that could be re-introduced as required at a future date.
Comment 25 Martin Renvoize 2024-02-07 16:41:08 UTC
Created attachment 161826 [details] [review]
Bug 35248: Add test for Koha::Exceptions::Booking
Comment 26 Martin Renvoize 2024-02-07 16:41:10 UTC
Created attachment 161827 [details] [review]
Bug 35248: Remove Koha::Booking->intersects

Another method left behind from an earlier iteration.. not actually
called anywhere in the final submission in Koha.
Comment 27 Martin Renvoize 2024-02-07 16:41:13 UTC
Created attachment 161828 [details] [review]
Bug 35248: Add unit tests for Koha::Booking relations

This patch adds unit tests for the relations introduced in the new
Koha::Booking class.

Test plan
1) Run t/db_dependent/Koha/Booking.t
Comment 28 Martin Renvoize 2024-02-07 16:41:15 UTC
Created attachment 161829 [details] [review]
Bug 35248: Add Koha::Biblio->bookings unit test

This patch adds unit tests for the bookings relationship accessor on
Koha::Biblio objects.

Test plan
1) Run t/db_dependant/Koha/Biblio.t
Comment 29 Martin Renvoize 2024-02-07 16:41:18 UTC
Created attachment 161830 [details] [review]
Bug 35248: Add unit tests for Koha::Bibilio->check_booking

This patch adds basic unit tests for Koha::Biblio->check_booking

Test plan
1) Run t/db_dependent/Koha/Biblio.t
Comment 30 Martin Renvoize 2024-02-07 16:41:20 UTC
Created attachment 161831 [details] [review]
Bug 35248: Add unit tests for Koha::Bibilio->bookable_items

This patch adds basic unit tests for Koha::Biblio->bookable_items

Test plan
1) Run t/db_dependent/Koha/Biblio.t
Comment 31 David Nind 2024-02-07 22:52:23 UTC
Created attachment 161861 [details] [review]
Bug 35248: Add unit test for Koha::Item->bookings relation

This patch adds a simple unit test for the 'bookings' relation accessor
added to Koha::Item.

Test plan
1) Run t/db_dependant/Koha/Item.t

Signed-off-by: David Nind <david@davidnind.com>
Comment 32 David Nind 2024-02-07 22:52:26 UTC
Created attachment 161862 [details] [review]
Bug 35248: Add unit tests for Koha::Item->find_booking

This patch adds basic unit tests for the Koha::Item->find_booking
method.

Test plan
1) Run t/db_dependant/Koha/Item.t

Signed-off-by: David Nind <david@davidnind.com>
Comment 33 David Nind 2024-02-07 22:52:29 UTC
Created attachment 161863 [details] [review]
Bug 35248: Unit tests for CanBookBeIssued

Whilst writing the test, I found a minor flaw in the logic and fixed
that in CanBookBeIssued at the same time.

Signed-off-by: David Nind <david@davidnind.com>
Comment 34 David Nind 2024-02-07 22:52:32 UTC
Created attachment 161864 [details] [review]
Bug 35248: Add unit tests for Koha::Item->check_booking

This patch adds basic unit tests for the Koha::Item->check_booking
method.

Test plan
1) Run t/db_dependant/Koha/Item.t

Signed-off-by: David Nind <david@davidnind.com>
Comment 35 David Nind 2024-02-07 22:52:43 UTC
Created attachment 161865 [details] [review]
Bug 35248: Drop ->place_booking

These methods were introduced and used in an earlier iteration of the
code, they are no longer called from anywhere (the code in
Koha::Booking->store handles all cases instead) and thus I choose to
remove them rather than add unit tests for them.. They are simple
methods that could be re-introduced as required at a future date.

Signed-off-by: David Nind <david@davidnind.com>
Comment 36 David Nind 2024-02-07 22:52:46 UTC
Created attachment 161866 [details] [review]
Bug 35248: Add test for Koha::Exceptions::Booking

Signed-off-by: David Nind <david@davidnind.com>
Comment 37 David Nind 2024-02-07 22:52:49 UTC
Created attachment 161867 [details] [review]
Bug 35248: Remove Koha::Booking->intersects

Another method left behind from an earlier iteration.. not actually
called anywhere in the final submission in Koha.

Signed-off-by: David Nind <david@davidnind.com>
Comment 38 David Nind 2024-02-07 22:52:53 UTC
Created attachment 161868 [details] [review]
Bug 35248: Add unit tests for Koha::Booking relations

This patch adds unit tests for the relations introduced in the new
Koha::Booking class.

Test plan
1) Run t/db_dependent/Koha/Booking.t

Signed-off-by: David Nind <david@davidnind.com>
Comment 39 David Nind 2024-02-07 22:52:56 UTC
Created attachment 161869 [details] [review]
Bug 35248: Add Koha::Biblio->bookings unit test

This patch adds unit tests for the bookings relationship accessor on
Koha::Biblio objects.

Test plan
1) Run t/db_dependant/Koha/Biblio.t

Signed-off-by: David Nind <david@davidnind.com>
Comment 40 David Nind 2024-02-07 22:52:59 UTC
Created attachment 161870 [details] [review]
Bug 35248: Add unit tests for Koha::Bibilio->check_booking

This patch adds basic unit tests for Koha::Biblio->check_booking

Test plan
1) Run t/db_dependent/Koha/Biblio.t

Signed-off-by: David Nind <david@davidnind.com>
Comment 41 David Nind 2024-02-07 22:53:02 UTC
Created attachment 161871 [details] [review]
Bug 35248: Add unit tests for Koha::Bibilio->bookable_items

This patch adds basic unit tests for Koha::Biblio->bookable_items

Test plan
1) Run t/db_dependent/Koha/Biblio.t

Signed-off-by: David Nind <david@davidnind.com>
Comment 42 David Nind 2024-02-07 22:53:56 UTC
I ran the tests before and after the patches were applied. I hope that is sufficient for testing.

Testing notes using koha-testing-docker:

1. Tests pass before and after patches applied:
   prove t/db_dependent/Circulation.t 
   prove t/Koha/Exceptions.t
   prove t/db_dependent/Koha/Item.t
   prove t/db_dependent/Koha/Booking.t (new tests)
   prove t/db_dependent/Koha/Biblio.t

2. Note: path to run the tests is t/db_dependent/Koha/Item.t (not db_dependant) for these patches:
  - Add unit test for Koha::Item->bookings relation
  - Add unit tests for Koha::Item->find_booking
  - Add unit tests for Koha::Item->check_booking
  - Add Koha::Biblio->bookings unit test
Comment 43 Martin Renvoize 2024-02-08 11:54:14 UTC
Created attachment 161890 [details] [review]
Bug 35248: Add tests for Koha::Booking->store

This patch adds tests for the Koha::Booking->store method.

Test plan
1) Run t/db_dependent/Koha/Booking.t and confirm they all pass
Comment 44 Martin Renvoize 2024-02-08 11:54:17 UTC
Created attachment 161891 [details] [review]
Bug 35248: Refactor - Move assign_item_for_booking

This routine really belongs inside Koha::Booking rather than
Koha::Biblio. This patch moves it there, renames with _ to highlight
it's private nature.

Test plan
1) Confirm that t/db_dependant/Koha/Booking.t still passes, specifically
   the 'store' test.
Comment 45 Martin Renvoize 2024-02-08 11:55:28 UTC
Thanks David, that's great :)

I've added a couple of further patches on top now too.. and there's one last one outstanding that I'm working on today.. resetting to assigned whilst I get that one done.. the more you look the more you see aye.
Comment 46 Martin Renvoize 2024-02-08 12:17:01 UTC
Created attachment 161893 [details] [review]
Bug 35248: Add tests for Koha::Booking->store

This patch adds tests for the Koha::Booking->store method.

Test plan
1) Run t/db_dependent/Koha/Booking.t and confirm they all pass
Comment 47 Martin Renvoize 2024-02-08 12:17:04 UTC
Created attachment 161894 [details] [review]
Bug 35248: Refactor - Move assign_item_for_booking

This routine really belongs inside Koha::Booking rather than
Koha::Biblio. This patch moves it there, renames with _ to highlight
it's private nature.

Test plan
1) Confirm that t/db_dependant/Koha/Booking.t still passes, specifically
   the 'store' test.
Comment 48 Martin Renvoize 2024-02-08 12:17:07 UTC
Created attachment 161895 [details] [review]
Bug 35248: Add tests for Koha::Booking->_assign_item_for_booking
Comment 49 Martin Renvoize 2024-02-08 12:19:33 UTC
Created attachment 161896 [details] [review]
Bug 35248: Add tests for Koha::Booking->_assign_item_for_booking
Comment 50 Martin Renvoize 2024-02-08 12:23:53 UTC
Created attachment 161897 [details] [review]
Bug 35248: Whitespace clean

Jonathan highlighted some trailing whitespace.. I only see a few cases
where a line only contains whitespace and I didn't see these caught by
the QA script at the time of submission.

Anyway, this removes the spaces
Comment 51 Nick Clemens 2024-02-08 13:10:25 UTC
Created attachment 161898 [details] [review]
Bug 35248: Add unit test for Koha::Item->bookings relation

This patch adds a simple unit test for the 'bookings' relation accessor
added to Koha::Item.

Test plan
1) Run t/db_dependant/Koha/Item.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 52 Nick Clemens 2024-02-08 13:10:27 UTC
Created attachment 161899 [details] [review]
Bug 35248: Add unit tests for Koha::Item->find_booking

This patch adds basic unit tests for the Koha::Item->find_booking
method.

Test plan
1) Run t/db_dependant/Koha/Item.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 53 Nick Clemens 2024-02-08 13:10:29 UTC
Created attachment 161900 [details] [review]
Bug 35248: Unit tests for CanBookBeIssued

Whilst writing the test, I found a minor flaw in the logic and fixed
that in CanBookBeIssued at the same time.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 54 Nick Clemens 2024-02-08 13:10:31 UTC
Created attachment 161901 [details] [review]
Bug 35248: Add unit tests for Koha::Item->check_booking

This patch adds basic unit tests for the Koha::Item->check_booking
method.

Test plan
1) Run t/db_dependant/Koha/Item.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 55 Nick Clemens 2024-02-08 13:10:34 UTC
Created attachment 161902 [details] [review]
Bug 35248: Drop ->place_booking

These methods were introduced and used in an earlier iteration of the
code, they are no longer called from anywhere (the code in
Koha::Booking->store handles all cases instead) and thus I choose to
remove them rather than add unit tests for them.. They are simple
methods that could be re-introduced as required at a future date.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 56 Nick Clemens 2024-02-08 13:10:36 UTC
Created attachment 161903 [details] [review]
Bug 35248: Add test for Koha::Exceptions::Booking

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 57 Nick Clemens 2024-02-08 13:10:38 UTC
Created attachment 161904 [details] [review]
Bug 35248: Remove Koha::Booking->intersects

Another method left behind from an earlier iteration.. not actually
called anywhere in the final submission in Koha.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 58 Nick Clemens 2024-02-08 13:10:41 UTC
Created attachment 161905 [details] [review]
Bug 35248: Add unit tests for Koha::Booking relations

This patch adds unit tests for the relations introduced in the new
Koha::Booking class.

Test plan
1) Run t/db_dependent/Koha/Booking.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 59 Nick Clemens 2024-02-08 13:10:43 UTC
Created attachment 161906 [details] [review]
Bug 35248: Add Koha::Biblio->bookings unit test

This patch adds unit tests for the bookings relationship accessor on
Koha::Biblio objects.

Test plan
1) Run t/db_dependant/Koha/Biblio.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 60 Nick Clemens 2024-02-08 13:10:45 UTC
Created attachment 161907 [details] [review]
Bug 35248: Add unit tests for Koha::Bibilio->check_booking

This patch adds basic unit tests for Koha::Biblio->check_booking

Test plan
1) Run t/db_dependent/Koha/Biblio.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 61 Nick Clemens 2024-02-08 13:10:47 UTC
Created attachment 161908 [details] [review]
Bug 35248: Add unit tests for Koha::Bibilio->bookable_items

This patch adds basic unit tests for Koha::Biblio->bookable_items

Test plan
1) Run t/db_dependent/Koha/Biblio.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 62 Nick Clemens 2024-02-08 13:10:50 UTC
Created attachment 161909 [details] [review]
Bug 35248: Add tests for Koha::Booking->store

This patch adds tests for the Koha::Booking->store method.

Test plan
1) Run t/db_dependent/Koha/Booking.t and confirm they all pass

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 63 Nick Clemens 2024-02-08 13:10:52 UTC
Created attachment 161910 [details] [review]
Bug 35248: Refactor - Move assign_item_for_booking

This routine really belongs inside Koha::Booking rather than
Koha::Biblio. This patch moves it there, renames with _ to highlight
it's private nature.

Test plan
1) Confirm that t/db_dependant/Koha/Booking.t still passes, specifically
   the 'store' test.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 64 Nick Clemens 2024-02-08 13:10:54 UTC
Created attachment 161911 [details] [review]
Bug 35248: Add tests for Koha::Booking->_assign_item_for_booking

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 65 Nick Clemens 2024-02-08 13:10:57 UTC
Created attachment 161912 [details] [review]
Bug 35248: Whitespace clean

Jonathan highlighted some trailing whitespace.. I only see a few cases
where a line only contains whitespace and I didn't see these caught by
the QA script at the time of submission.

Anyway, this removes the spaces

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>