Bugzilla – Attachment 173200 Details for
Bug 38235
Suggestion confirmation letter sent when it should not
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38235: Unit tests
Bug-38235-Unit-tests.patch (text/plain), 2.85 KB, created by
Janusz Kaczmarek
on 2024-10-23 10:08:42 UTC
(
hide
)
Description:
Bug 38235: Unit tests
Filename:
MIME Type:
Creator:
Janusz Kaczmarek
Created:
2024-10-23 10:08:42 UTC
Size:
2.85 KB
patch
obsolete
>From 005e5ddd349a57796c8a9ad9707e23e726bb4c58 Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Tue, 22 Oct 2024 11:39:09 +0000 >Subject: [PATCH] Bug 38235: Unit tests > >BTW, tiny adjustments to existing tests to work with modified >C4::Suggestions::ModSuggestion. >--- > t/db_dependent/Suggestions.t | 23 +++++++++++++++++++++-- > 1 file changed, 21 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Suggestions.t b/t/db_dependent/Suggestions.t >index 97a0d80ab9..c25a97da7d 100755 >--- a/t/db_dependent/Suggestions.t >+++ b/t/db_dependent/Suggestions.t >@@ -18,7 +18,7 @@ > use Modern::Perl; > > use DateTime::Duration; >-use Test::More tests => 92; >+use Test::More tests => 94; > use Test::Warn; > > use t::lib::Mocks; >@@ -64,6 +64,7 @@ $dbh->do(q|DELETE FROM borrowers|); > $dbh->do(q|DELETE FROM letter|); > $dbh->do(q|DELETE FROM message_queue|); > $dbh->do(q|INSERT INTO letter(module, code, content) VALUES ('suggestions', 'CHECKED', 'my content')|); >+$dbh->do(q|INSERT INTO letter(module, code, content) VALUES ('suggestions', 'ORDERED', 'my content')|); > $dbh->do(q|INSERT INTO letter(module, code, content) VALUES ('suggestions', 'NEW_SUGGESTION', 'Content for new suggestion')|); > > # Add CPL if missing. >@@ -242,7 +243,11 @@ is ($messages->[0]->{message_transport_type}, 'email', 'When FallbackToSMSIfNoEm > > #Check the message_transport_type when the 'FallbackToSMSIfNoEmail' syspref is enabled and the borrower has a smsalertnumber and no email > t::lib::Mocks::mock_preference( 'FallbackToSMSIfNoEmail', 1 ); >-ModSuggestion($mod_suggestion3); >+my $mod_suggestion3a = { >+ STATUS => 'ORDERED', >+ suggestionid => $my_suggestionid, >+}; >+ModSuggestion($mod_suggestion3a); > $messages = C4::Letters::GetQueuedMessages({ > borrowernumber => $borrowernumber > }); >@@ -264,6 +269,20 @@ $messages = C4::Letters::GetQueuedMessages({ > }); > is ($messages->[0]->{message_transport_type}, 'email', 'When FallbackToSMSIfNoEmail syspref is enabled the suggestion message_transport_type is email if the borrower has an email'); > >+# changing STATUS from ORDERED to CHECKED should generate a message >+my $mod_suggestion5 = { >+ STATUS => 'CHECKED', >+ suggestionid => $my_suggestionid, >+}; >+$status = ModSuggestion($mod_suggestion5); >+$messages = C4::Letters::GetQueuedMessages( { borrowernumber => $borrowernumber } ); >+is( @$messages, 3, 'ModSuggestions does send a message if the status has been changed' ); >+ >+# modifying suggestion without changing STATUS should not generate a message >+$status = ModSuggestion($mod_suggestion5); >+$messages = C4::Letters::GetQueuedMessages( { borrowernumber => $borrowernumber } ); >+is( @$messages, 3, 'ModSuggestions does send a message if the status has been changed' ); >+ > { > # Hiding the expected warning displayed by DBI > # DBD::mysql::st execute failed: Incorrect date value: 'invalid date!' for column 'manageddate' >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38235
:
173199
|
173200
|
173227
|
173228
|
174391
|
174392