Bugzilla – Attachment 39490 Details for
Bug 13972
Include fields from subscription and serial table in serial notification email
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13972: Follow-up - Add unit tests for changed parts of SendAlerts
Bug-13972-Follow-up---Add-unit-tests-for-changed-p.patch (text/plain), 2.90 KB, created by
Katrin Fischer
on 2015-05-25 15:06:33 UTC
(
hide
)
Description:
Bug 13972: Follow-up - Add unit tests for changed parts of SendAlerts
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2015-05-25 15:06:33 UTC
Size:
2.90 KB
patch
obsolete
>From 167a79780dd54abd81eb1f186c11fa474f350bf7 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <Katrin.Fischer.83@web.de> >Date: Mon, 25 May 2015 17:01:46 +0200 >Subject: [PATCH] Bug 13972: Follow-up - Add unit tests for changed parts of > SendAlerts > >To test: >- prove t/db_dependent/Letters.t >--- > t/db_dependent/Letters.t | 43 ++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 42 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Letters.t b/t/db_dependent/Letters.t >index f53e75b..91723c5 100644 >--- a/t/db_dependent/Letters.t >+++ b/t/db_dependent/Letters.t >@@ -18,7 +18,7 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 58; >+use Test::More tests => 62; > use Test::MockModule; > use Test::Warn; > >@@ -332,6 +332,7 @@ $bookseller->contacts->[0]->email('testemail@mydomain.com'); > C4::Bookseller::ModBookseller($bookseller); > $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid }); > >+{ > warning_is { > $err = SendAlerts( 'claimacquisition', [ $ordernumber ], 'TESTACQCLAIM' ) } > "Fake sendmail", >@@ -340,5 +341,45 @@ warning_is { > is($err, 1, "Successfully sent claim"); > is($mail{'To'}, 'testemail@mydomain.com', "mailto correct in sent claim"); > is($mail{'Message'}, 'my vendor|John Smith|Ordernumber ' . $ordernumber . ' (Silence in the library) (1 ordered)', 'Claim notice text constructed successfully'); >+} >+ >+{ >+use C4::Serials; >+ >+my $notes = 'notes'; >+my $internalnotes = 'intnotes'; >+my $subscriptionid = NewSubscription( >+ undef, "", undef, undef, undef, $biblionumber, >+ '2013-01-01', 1, undef, undef, undef, >+ undef, undef, undef, undef, undef, undef, >+ 1, $notes,undef, '2013-01-01', undef, 1, >+ undef, undef, 0, $internalnotes, 0, >+ undef, undef, 0, undef, '2013-12-31', 0 >+); >+$dbh->do(q{INSERT INTO letter (module, code, name, title, content) VALUES ('serial','RLIST','Serial issue notification','Serial issue notification','<<biblio.title>>,<<subscription.subscriptionid>>,<<serial.serialseq>>');}); >+my ($serials_count, @serials) = GetSerials($subscriptionid); >+my $serial = $serials[0]; >+ >+my $borrowernumber = AddMember( >+ firstname => 'John', >+ surname => 'Smith', >+ categorycode => 'PT', >+ branchcode => 'CPL', >+ dateofbirth => $date, >+ email => 'john.smith@test.de', >+); >+my $alert_id = C4::Letters::addalert($borrowernumber, 'issue', $subscriptionid); >+ >+ >+my $err2; >+warning_is { >+$err2 = SendAlerts( 'issue', $serial->{serialid}, 'RLIST' ) } >+ "Fake sendmail", >+ "SendAlerts is using the mocked sendmail routine"; >+is($err2, "", "Successfully sent serial notification"); >+is($mail{'To'}, 'john.smith@test.de', "mailto correct in sent serial notification"); >+is($mail{'Message'}, 'Silence in the library,'.$subscriptionid.',No. 0', 'Serial notification text constructed successfully'); >+} >+ > > $dbh->rollback; >-- >1.9.1
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 13972
:
39487
|
39489
|
39490
|
40021
|
40022
|
40273
|
40274