[Koha-bugs] [Bug 30165] Several q parameters break the filters

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Mar 24 13:46:26 CET 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30165

--- Comment #22 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
Created attachment 132138
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132138&action=edit
[OPTION 1] Bug 30165: (follow-up) Address OpenAPI vs. no-OpenAPI in the tests

Our objects.search helper is written for being used in our API
controllers, which get their query parameters processed by the OpenAPI
plugin, using JSON::Validator.

Particularly, the 'q' parameter is defined as 'multi' on our spec, which
means objects.search always gets it as an arrayref.

As the Objects.t tests are not using the OpenAPI plugin, a hashref is
generated as only one q= is being passed. This patch adds an extra
(empty) q param to the tests to overcome this.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t
=> FAIL: Tests fail!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list