Bugzilla – Attachment 31030 Details for
Bug 11244
notices ignoring the dateformat preference
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11244: Add unit tests for GetPreparedLetter
Bug-11244-Add-unit-tests-for-GetPreparedLetter.patch (text/plain), 3.46 KB, created by
Jonathan Druart
on 2014-08-20 15:59:18 UTC
(
hide
)
Description:
Bug 11244: Add unit tests for GetPreparedLetter
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-08-20 15:59:18 UTC
Size:
3.46 KB
patch
obsolete
>From 812e26619182cea8b327cc6b32cab27a262ba5e3 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 20 Aug 2014 17:58:32 +0200 >Subject: [PATCH] Bug 11244: Add unit tests for GetPreparedLetter > >--- > t/db_dependent/Letters.t | 21 +++++++++++++++++---- > 1 file changed, 17 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/Letters.t b/t/db_dependent/Letters.t >index bf0c1a1..89e511a 100644 >--- a/t/db_dependent/Letters.t >+++ b/t/db_dependent/Letters.t >@@ -21,10 +21,13 @@ use Modern::Perl; > > use Test::More tests => 45; > >+use MARC::Record; >+use C4::Biblio qw( AddBiblio ); > use C4::Context; > use C4::Letters; > use C4::Members; > use C4::Branch; >+use Koha::DateUtils qw( dt_from_string output_pref ); > use t::lib::Mocks; > > my $dbh = C4::Context->dbh; >@@ -37,13 +40,17 @@ $dbh->do(q|DELETE FROM letter|); > $dbh->do(q|DELETE FROM message_queue|); > $dbh->do(q|DELETE FROM message_transport_types|); > >+my $date = dt_from_string; > my $borrowernumber = AddMember( > firstname => 'Jane', > surname => 'Smith', > categorycode => 'PT', > branchcode => 'CPL', >+ dateofbirth => $date, > ); > >+my $marc_record = MARC::Record->new; >+my( $biblionumber, $biblioitemnumber ) = AddBiblio( $marc_record, '' ); > > # GetMessageTransportTypes > my $mtts = C4::Letters::GetMessageTransportTypes(); >@@ -126,7 +133,10 @@ The following item(s) is/are currently <<status>>: > > <item> <<count>>. <<items.itemcallnumber>>, Barcode: <<items.barcode>> </item> > >-Thank-you for your prompt attention to this matter.|; >+Thank-you for your prompt attention to this matter. >+Don't forget your date of birth: <<borrowers.dateofbirth>>. >+Look at this wonderful biblio timestamp: <<biblio.timestamp>>. >+|; > > $dbh->do( q|INSERT INTO letter(branchcode,module,code,name,is_html,title,content,message_transport_type) VALUES ('CPL','my module','my code','my name',1,?,?,'email')|, undef, $title, $content ); > $letters = C4::Letters::GetLetters(); >@@ -189,12 +199,13 @@ is( @$alerts, 0, 'delalert removes an alert' ); > # GetPreparedLetter > t::lib::Mocks::mock_preference('OPACBaseURL', 'http://thisisatest.com'); > >-$content = 'This is a SMS for an <<status>>'; >-$dbh->do( q|INSERT INTO letter(branchcode,module,code,name,is_html,title,content,message_transport_type) VALUES ('CPL','my module','my code','my name',1,'my title',?,'sms')|, undef, $content ); >+my $sms_content = 'This is a SMS for an <<status>>'; >+$dbh->do( q|INSERT INTO letter(branchcode,module,code,name,is_html,title,content,message_transport_type) VALUES ('CPL','my module','my code','my name',1,'my title',?,'sms')|, undef, $sms_content ); > > my $tables = { > borrowers => $borrowernumber, > branches => 'CPL', >+ biblio => $biblionumber, > }; > my $substitute = { > status => 'overdue', >@@ -231,7 +242,9 @@ The following item(s) is/are currently $substitute->{status}: > <item> 1. $repeat->[0]->{itemcallnumber}, Barcode: $repeat->[0]->{barcode} </item> > <item> 2. $repeat->[1]->{itemcallnumber}, Barcode: $repeat->[1]->{barcode} </item> > >-Thank-you for your prompt attention to this matter.|; >+Thank-you for your prompt attention to this matter. >+Don't forget your date of birth: | . output_pref({ dt => $date, dateonly => 1 }) . q|. >+Look at this wonderful biblio timestamp: | . output_pref({ dt => $date }) . ".\n"; > is( $prepared_letter->{title}, $my_title_letter, 'GetPreparedLetter returns the title correctly' ); > is( $prepared_letter->{content}, $my_content_letter, 'GetPreparedLetter returns the content correctly' ); > >-- >2.0.0.rc2
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 11244
:
22912
|
22963
|
23213
|
23711
|
23965
|
24557
|
24558
|
29650
|
29651
|
30126
|
30127
| 31030