Bug 26108: Regression tests
authorTomas Cohen Arazi <tomascohen@theke.io>
Fri, 31 Jul 2020 12:47:56 +0000 (09:47 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 31 Jul 2020 13:04:44 +0000 (15:04 +0200)
commita51b06001f2f8e42efc48d1898060f1d8d23ae62
tree31dc7bc733dfafb85e40a0159a8bd692cabb8fed
parent67f6ceecd314fadd96e3dbc5fc543dd0528b050a
Bug 26108: Regression tests

The current implementation makes the assumption that if $issue is
defined, then it is the 'return' use case. This is correct, but
incomplete: after verifying that there's actually an issue, the return
can be rejected for various reasons.

This patch introduces a regression test for one of those situations
(which I consider enough for testing purposes) . It highlights that the
hook shouldn't be called if there hasn't been an actual checkin.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Plugins/Circulation_hooks.t
=> FAIL: Tests fail because there's an unexpected warining printed by
the erroneous plugin call (i.e. there's been no return but the plugin is
called anyway).

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
t/db_dependent/Koha/Plugins/Circulation_hooks.t