Koha/t/Koha
Tomas Cohen Arazi ad83d2e07d
Bug 33080: Allow pagination to be built from stashed values
The way the old `objects.search` was build implied several totals were
calculated there, and passed to the `$c->add_pagination_headers` helper.

With the introduction of `objects.search_rs` and the ability of doing
things to the resultset afterwards, it felt like out of place to have
the pagination headers be implicitly set inside `objects.search_rs`.

This patch makes the search_rs stash some required values (from the original request) and
makes `add_pagination_headers` accept those values. This way other
callers can still build their own pagination values, while allowing this
simplified implementation.

Full-stack tests still pass, and the helper tests are moved to the
`db_dependent` section and are now more meaningful as well

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
   $ prove t/db_dependent/Koha/REST/Plugin/Pagination.t \
           t/db_dependent/api/v1/
=> SUCCESS: Tests pass! Nothing broken!
3. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-03-10 12:04:06 -03:00
..
Auth Bug 20256: Add unit tests 2023-02-02 11:59:26 -03:00
Authority
Database
I18N/po/xx_XX/LC_MESSAGES
Middleware
Object
Plugins
REST/Plugin Bug 33080: Allow pagination to be built from stashed values 2023-03-10 12:04:06 -03:00
Result
SearchEngine
Util
Config.t
Email.t
Exceptions.t
I18N.t
ItemType.t
RDF.t
Script.t
Script_cron.t
sleep.pl
wait.pl
Z3950responder.t