Bugzilla – Attachment 73750 Details for
Bug 18725
process_message_queue.pl sends duplicate emails if message_queue is not writable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18725: Tests to trigger canary case
Bug-18725-Tests-to-trigger-canary-case.patch (text/plain), 1.97 KB, created by
Marcel de Rooy
on 2018-04-06 09:17:09 UTC
(
hide
)
Description:
Bug 18725: Tests to trigger canary case
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2018-04-06 09:17:09 UTC
Size:
1.97 KB
patch
obsolete
>From f810c95d49e66e4187a65b9749429b5cde350540 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Mon, 26 Mar 2018 05:39:58 +0000 >Subject: [PATCH] Bug 18725: Tests to trigger canary case >Content-Type: text/plain; charset=utf-8 > >Since replicating the conditions necessary for the canary case >proved difficult, tests were written to simulate it. > >prove t/db_dependent/Letters.t > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Letters.t | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > >diff --git a/t/db_dependent/Letters.t b/t/db_dependent/Letters.t >index 1a61793..8ceddfb 100644 >--- a/t/db_dependent/Letters.t >+++ b/t/db_dependent/Letters.t >@@ -751,3 +751,31 @@ subtest 'Test limit parameter for SendQueuedMessages' => sub { > is( $messages_processed, 2, > 'Processed 2 message with limit of 3 and 2 unprocessed messages' ); > }; >+ >+subtest 'Test canary call for SendQueuedMessages' => sub { >+ plan tests => 2; >+ >+ my $letter = { >+ 'letter' => { >+ 'content' => 'a message', >+ 'metadata' => 'metadata', >+ 'code' => 'TEST_MESSAGE', >+ 'content_type' => 'text/plain', >+ 'title' => 'message title' >+ }, >+ 'borrowernumber' => $borrowernumber, >+ 'to_address' => undef, >+ 'message_transport_type' => 'email', >+ 'from_address' => 'from@example.com' >+ }; >+ C4::Letters::EnqueueLetter($letter); >+ >+ my $mocked_storing = Test::MockModule->new('Koha::Object'); >+ $mocked_storing->mock('store' => sub { return; }); >+ $messages_processed = C4::Letters::SendQueuedMessages(); >+ is( $messages_processed, undef, 'Bad store should prevent sending any.'); >+ $mocked_storing->unmock('store'); >+ $messages_processed = C4::Letters::SendQueuedMessages(); >+ is( $messages_processed, 1, 'Good store should send.'); >+ >+} >-- >2.1.4
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 18725
:
64803
|
65625
|
68602
|
68603
|
70805
|
70826
|
70853
|
70876
|
73277
|
73278
|
73749
|
73750
|
73751
|
74143
|
74247