Bug 22709: Unit tests
authorTomas Cohen Arazi <tomascohen@theke.io>
Fri, 21 Jun 2019 20:09:56 +0000 (17:09 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 4 Jul 2019 12:49:21 +0000 (13:49 +0100)
commitd766b6926bc104bd10050f1f49d4414dc9555475
treed7903661f310e3c340c2ce80c5625e5e97c2d12a
parent9638caf87234524e447fe5ab028ac4946726e823
Bug 22709: Unit tests

This patch introduces tests for new plugin hooks added to
C4::Biblio::{Add|Mod|Del}Biblio and C4::Items::{Add|Mod|Del}Item.

They are tested together as for creating an item you need to first create
a biblio and tests looks basically the same.

The testing strategy is
- Make sure the plugin is passed the right params
- Throw an exception at plugin-level, to be trapped by the C4::Biblio
and C4::Items lib, and converted into a warning. So we test for the
warning.
- Also, the fact that C4::Biblio and C4::Items warns, means the
exception was cought, and then Koha won't break on faulty plugins or
fatal errors from plugins.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
t/db_dependent/Biblio_and_Items_plugin_hooks.t [new file with mode: 0755]
t/lib/Koha/Plugin/Test.pm