Bug 21912 - Koha::Objects->search lacks tests
Summary: Koha::Objects->search lacks tests
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Tomás Cohen Arazi (tcohen)
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-29 14:58 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2020-01-06 20:14 UTC (History)
6 users (show)

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


Attachments
Bug 21912: Add tests for Koha::Objects->search (1.71 KB, patch)
2018-11-29 15:00 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 21912: Add tests for Koha::Objects->search (1.77 KB, patch)
2018-11-29 15:33 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 21912: (QA follow-up) Do not delete existing patrons (1.32 KB, patch)
2018-12-26 17:56 UTC, Tomás Cohen Arazi (tcohen)
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 (tcohen) 2018-11-29 14:58:07 UTC
The 'search' method in Koha::Objects uses the context in which it was called to return either an iterator (in scalar context) or a list of singular objects, in list context.

This behaviour should be covered by tests.
Comment 1 Tomás Cohen Arazi (tcohen) 2018-11-29 15:00:44 UTC
Created attachment 82745 [details] [review]
Bug 21912: Add tests for Koha::Objects->search

This patch adds simple tests for the current behaviour. Specifically the
return values in both scalar and list context.

To test:
- Apply this patch
- Run:
  $ prove t/db_dependent/Koha/Objects.t
=> SUCCESS: Tests pass
- Sign off :-D
Comment 2 Martin Renvoize (ashimema) 2018-11-29 15:33:11 UTC
Created attachment 82750 [details] [review]
Bug 21912: Add tests for Koha::Objects->search

This patch adds simple tests for the current behaviour. Specifically the
return values in both scalar and list context.

To test:
- Apply this patch
- Run:
  $ prove t/db_dependent/Koha/Objects.t
=> SUCCESS: Tests pass
- Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize (ashimema) 2018-11-29 15:35:10 UTC
Trivial patch to increase the test coverage.. straight to PQA
Comment 4 Tomás Cohen Arazi (tcohen) 2018-12-26 17:56:32 UTC
Created attachment 83514 [details] [review]
Bug 21912: (QA follow-up) Do not delete existing patrons

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 5 Nick Clemens (kidclamp) 2019-01-11 13:34:00 UTC
Awesome work all!

Pushed to master for 19.05
Comment 6 Martin Renvoize (ashimema) 2019-01-14 14:07:45 UTC
Never a bad idea to increase test coverage... choosing to backport this 'tests only' patch.

Pushed to 18.11.x for 18.11.02
Comment 7 Jesse Maseto 2019-01-23 19:24:04 UTC
Pushed to 18.05.x for 18.05.09
Comment 8 Fridolin Somers 2019-01-30 08:03:43 UTC
Pushed to 17.11.x for 17.11.15