]> git.koha-community.org Git - koha.git/commit
Bug 30125: Add full-stack tests for API pagination
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 17 Feb 2022 17:50:14 +0000 (14:50 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 4 Mar 2022 02:11:49 +0000 (16:11 -1000)
commit18ba814d6a70a60e6892003dce349919e203e13b
tree66c149bdfdf8fe3bb8050c72d87f8024c121dbab
parent15acfaefb638870ff64d54a87bf68907fb6f6fd7
Bug 30125: Add full-stack tests for API pagination

This patch adds tests for all the pagination use cases on a real route
(GET /cities). It tests _page, _per_page along with the returned Link
headers and total counts (i.e. X-Total-Count, X-Base-Total-Count), and
the results themselves.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/pagination.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
t/db_dependent/api/v1/pagination.t [new file with mode: 0755]