Bug 27333 - Wrong exception thrown in Koha::Club::Hold::add
Summary: Wrong exception thrown in Koha::Club::Hold::add
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Keywords:
Depends on: 27327
Blocks: 27330
  Show dependency treegraph
 
Reported: 2021-01-04 14:14 UTC by Tomás Cohen Arazi
Modified: 2021-06-14 21:34 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.03,20.05.09,19.11.15


Attachments
Bug 27333: Regression tests (4.29 KB, patch)
2021-01-04 14:17 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 27333: Throw the right exceptions (1.61 KB, patch)
2021-01-04 14:17 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 27333: Regression tests (4.35 KB, patch)
2021-01-26 16:32 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 27333: Throw the right exceptions (1.68 KB, patch)
2021-01-26 16:32 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2021-01-04 14:14:12 UTC
It should be returning Koha::Exceptions::MissingParameter. And is returning a generic Koha::Exceptions::ClubHold exception.
Comment 1 Tomás Cohen Arazi 2021-01-04 14:17:44 UTC
Created attachment 114793 [details] [review]
Bug 27333: Regression tests

Test for the right exceptions
Comment 2 Tomás Cohen Arazi 2021-01-04 14:17:47 UTC
Created attachment 114794 [details] [review]
Bug 27333: Throw the right exceptions

If parameters are missing, we need to throw
Koha::Exceptions::MissingParameter exceptions.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Club/Hold.t
=> FAIL: Tests fail because the method doesn't throw the right
exceptions
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D
Comment 3 Martin Renvoize 2021-01-26 16:32:22 UTC
Created attachment 115827 [details] [review]
Bug 27333: Regression tests

Test for the right exceptions

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2021-01-26 16:32:25 UTC
Created attachment 115828 [details] [review]
Bug 27333: Throw the right exceptions

If parameters are missing, we need to throw
Koha::Exceptions::MissingParameter exceptions.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Club/Hold.t
=> FAIL: Tests fail because the method doesn't throw the right
exceptions
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize 2021-01-26 16:33:09 UTC
Going for a straight QA here.

Follows best practice and is a clear improvement. No regressions found, QA scripts pass and regression tests are included.

Passing QA :)
Comment 6 Jonathan Druart 2021-01-27 13:37:38 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 7 Fridolin Somers 2021-01-29 14:29:15 UTC
Pushed to 20.11.x for 20.11.03
Comment 8 Andrew Fuerste-Henry 2021-02-04 21:25:55 UTC
Pushed to 20.05.x for 20.05.09
Comment 9 Victor Grousset/tuxayo 2021-02-08 23:20:06 UTC
Backported: Pushed to 19.11.x branch for 19.11.15