Bug 21912 - Koha::Objects->search lacks tests
Summary: Koha::Objects->search lacks tests
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-29 14:58 UTC by Tomás Cohen Arazi
Modified: 2019-02-25 07:04 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 21912: Add tests for Koha::Objects->search (1.71 KB, patch)
2018-11-29 15:00 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 21912: Add tests for Koha::Objects->search (1.77 KB, patch)
2018-11-29 15:33 UTC, Martin Renvoize
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
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 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 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 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 2018-11-29 15:35:10 UTC
Trivial patch to increase the test coverage.. straight to PQA
Comment 4 Tomás Cohen Arazi 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 2019-01-11 13:34:00 UTC
Awesome work all!

Pushed to master for 19.05
Comment 6 Martin Renvoize 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