]> git.koha-community.org Git - koha.git/commit
Bug 20866: Make ArticleRequests.t pass even if table is not empty
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 4 Jun 2018 18:28:02 +0000 (15:28 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 8 Jun 2018 10:08:07 +0000 (10:08 +0000)
commit6123e213e6a4c9353175e0cf2e2a638d03c95b1c
tree294458a5883d9d33e10532ac9f269463daedbfa5
parent63673d70cd08b198d3b904b73da82f1e06d64f7b
Bug 20866: Make ArticleRequests.t pass even if table is not empty

Previous patch from Marcel removed the data from article_requests, I do
not think it is a good idea to remove existing data, it could hide bugs.

This patch moves the count inside the subtest block in order to have the
correct value when these tests are executed.
Previous code was broken: Koha::Patron->store does not generate a
userid, and ->search_limited did not work correctly
(Koha::Patron->has_permission returned early because of the non-existing
userid, 'return unless $self->userid;');

Test plan:
[1] Create an article request.
[2] Run t/db_dependent/ArticleRequests.t

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
t/db_dependent/ArticleRequests.t