Koha-clms/t/db_dependent/Koha
Nick Clemens f719371662 Bug 15986: Add a script for sending hold waiting reminder notices
This patch adds a script for sending holds reminder notice to patrons.

We add a 'send_notice' routine to Koha::Patrons - this will either send using the patron's
email prefs, or allow forcing of a single method via the cron

To test:
 1 - Create an email hold reminder notice for a single library (Koha module: Holds, code HOLDREMINDER, branch: CPL)
 2 - Set some waiting holds today for patrons at CPL, ensure those patrons have 'email' as the transport for hold filled notices
 3 - perl misc/cronjobs/holds_reminder.pl -v -lettercode HOLDREMINDER -n -li CPL
 4 - You should see the patrons here would have received emails
 5 - perl misc/cronjobs/holds_reminder.pl -v -lettercode HOLDREMINDER -li CPL
 6 - You should see the emails that were sent
 7 - Check the patron notices tab to confirm
 8 - Note a ptron with two holds waiting receives only one notice
 9 - perl misc/cronjobs/holds_reminder.pl -v -lettercode HOLDREMINDER -li CPL -days 3
10 - No notices are sent
11 - Adjust the waiting date for the holds:
    UPDATE reserves SET waitingdate=DATE_SUB(CURDATE(), INTERVAL 3 DAY) WHERE waitingdate = CURDATE();
12 - perl misc/cronjobs/holds_reminder.pl -v -lettercode HOLDREMINDER -li CPL -days 3
13 - Confirm the holds are now reminded
14 - Set yesterday as a holiday for CPL
15 - perl misc/cronjobs/holds_reminder.pl -v -lettercode HOLDREMINDER -n -li CPL -holidays -days 3
16 - Notices should not be sent
17 - perl misc/cronjobs/holds_reminder.pl -v -lettercode HOLDREMINDER -n -li CPL -holidays -days 2
18 - Notices should be sent again
19 - perl misc/cronjobs/holds_reminder.pl -v -lettercode HOLDREMINDER -n -holidays -days 2
20 - Should get feedback that notice was not found for other libraries
21 - perl misc/cronjobs/holds_reminder.pl -v -lettercode HOLDREMINDER -n -holidays -days 2 -mtt sms
22 - Notice is not found
23 - Add the notice for sms
24 - perl misc/cronjobs/holds_reminder.pl -v -lettercode HOLDREMINDER -n -holidays -days 2 -mtt sms
25 - The notice should be sent
26 - Check patrons messaging tab to confirm
27 - prove -v t/db_dependent/Koha/Patrons.t

Sponsored by: The Hotchkiss School (http://www.hotchkiss.org/)

Signed-off-by: Kim Gnerre <kgnerre@hotchkiss.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-04-16 14:15:37 +02:00
..
Account Bug 27927: Add Unit Tests 2021-04-16 12:28:17 +02:00
Acquisition Bug 25670: Fix random failure on Orders.t 2021-02-01 10:35:14 +01:00
Biblio Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
BiblioUtils Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Cash Bug 26274: (QA follow-up) Minor fixes 2021-02-12 12:33:41 +01:00
Charges Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Checkouts Bug 27004: Regression tests 2021-01-04 13:29:47 +01:00
Club Bug 27333: Regression tests 2021-01-27 10:45:54 +01:00
Config Bug 27154: Fix test if the cache is populated already 2021-02-09 09:21:31 +01:00
Filter Bug 26250: Fix tests when SearchEngine=Elastic 2020-08-31 16:10:26 +02:00
IssuingRules Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Item Bug 27993: Add unit tests 2021-04-01 17:58:49 +02:00
Library Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Objects/Mixin Bug 23994: Fix random failure from AdditionalFields.t (U18) 2019-11-08 09:31:47 +00:00
Patron Bug 28031: Add missing txn_begin in Attribute.t 2021-04-09 15:43:34 +02:00
Patrons Bug 26059: Add unit tests 2021-02-12 12:14:50 +01:00
Plugins Bug 26470: Regression tests 2020-09-18 10:38:01 +02:00
REST Bug 26636: Regression tests for undef case 2021-03-09 10:31:47 +01:00
SMTP Bug 26595: Remove password from the smtp_server API object 2020-10-14 15:53:38 +02:00
SearchEngine Bug 22824: Replace YAML::Syck with YAML::XS 2021-03-04 16:18:42 +01:00
Subscription Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Tags Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Template/Plugin Bug 24665: (QA follow-up) Add tests for 'selected' 2020-11-06 17:30:08 +01:00
XSLT Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Z3950Responder Bug 26057: (QA follow-up) Fix Biblios, Reserves, Z3950Responder and XSLT tests 2021-03-04 09:49:30 +01:00
Account.t Bug 25508: Add Unit Tests 2021-04-16 12:01:49 +02:00
ActionLogs.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
ApiKeys.t Bug 26157: Hide expected DBI warnings from tests 2020-08-24 11:19:03 +02:00
Authorities.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
BackgroundJobs.t Bug 27317: (Bug 27127 follow-up) fix t/db_dependent/Koha/BackgroundJobs.t 2020-12-30 12:05:12 -03:00
Biblio.t Bug 27069: Adjust tests 2021-04-07 16:08:04 +02:00
BiblioFrameworks.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Biblios.t Bug 26057: (QA follow-up) Fix Biblios, Reserves, Z3950Responder and XSLT tests 2021-03-04 09:49:30 +01:00
Checkout.t Bug 26327: Add exec flag on .t file 2020-10-14 14:50:07 +02:00
Checkouts.t Bug 27851: Add tests 2021-03-05 13:54:13 +01:00
CirculationRules.t Bug 23091: Update unit test 2020-11-06 15:55:17 +01:00
Cities.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
ClassSortRules.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
ClassSources.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
ClassSplitRules.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
CoverImages.t Bug 26145: Add exec flag on .t file 2020-10-12 12:36:27 +02:00
CsvProfiles.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Database.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Desks.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Hold.t Bug 27209: (follow-up) Add ->is_pickup_location_valid 2020-12-21 10:07:45 +01:00
Holds.t Bug 27069: Adjust tests 2021-04-07 16:08:04 +02:00
IssuingRules.t Bug 23091: Update unit test 2020-11-06 15:55:17 +01:00
Item.t Bug 27069: Adjust tests 2021-04-07 16:08:04 +02:00
ItemTypes.t Bug 27491: Rename system preference opaclanguages to OPACLanguages 2021-01-22 14:59:27 +01:00
Items.t Bug 28125: Display a warning on the about page for OPACHiddenItems is needed 2021-04-16 12:28:17 +02:00
KeyboardShortcuts.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Libraries.t Bug 22569: Add Unit Tests 2021-03-11 11:51:40 +01:00
Library.t Bug 26595: Embed the whole smtp_server object 2020-10-14 15:53:38 +02:00
MarcSubfieldStructures.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
News.t Bug 27714: Prevent Koha::NewsItem->author to explode 2021-02-23 13:12:56 +01:00
Notices.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Object.t Bug 26555: Make sure _messages is always initialized 2020-10-15 14:50:06 +02:00
Objects.t Bug 21549: Make filter_by_last_update returns a Koha::Objects-based object 2021-04-14 15:34:27 +02:00
Old.t Bug 26327: Add ->library method to Koha::*Checkout 2020-10-14 14:50:06 +02:00
Patron.t Bug 28031: Fix patron.t 2021-04-09 15:43:34 +02:00
Patrons.t Bug 15986: Add a script for sending hold waiting reminder notices 2021-04-16 14:15:37 +02:00
Pseudonymization.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Quotes.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Ratings.t Bug 26250: Fix tests when SearchEngine=Elastic 2020-08-31 16:10:26 +02:00
Reports.t Bug 24695: Move to Koha::Report->is_sql_valid 2021-04-12 15:27:50 +02:00
Reviews.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
SMS_Providers.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
SearchField.t Bug 19482: (follow-up) Fix update, add tests, restore closing </td> 2020-11-04 12:59:33 +01:00
SharedContent.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Statistics.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Subscription.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Suggestion.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Suggestions.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Tags.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Z3950Servers.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00