Bugzilla – Attachment 120203 Details for
Bug 28230
Renewing/Checking out record with AE or OE letter in title can make Koha totally unfunctional
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28230: Add tests
Bug-28230-Add-tests.patch (text/plain), 2.77 KB, created by
Jonathan Druart
on 2021-04-27 08:37:21 UTC
(
hide
)
Description:
Bug 28230: Add tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-04-27 08:37:21 UTC
Size:
2.77 KB
patch
obsolete
>From e584e794aaf27e0b81c503f3966aa845593ffec2 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 27 Apr 2021 10:06:39 +0200 >Subject: [PATCH] Bug 28230: Add tests > >--- > t/db_dependent/Message.t | 73 ++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 73 insertions(+) > create mode 100644 t/db_dependent/Message.t > >diff --git a/t/db_dependent/Message.t b/t/db_dependent/Message.t >new file mode 100644 >index 00000000000..390cfa458c0 >--- /dev/null >+++ b/t/db_dependent/Message.t >@@ -0,0 +1,73 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+use Test::More tests => 3; >+use Test::MockModule; >+use Test::Warn; >+ >+use Encode; >+ >+use t::lib::TestBuilder; >+use t::lib::Mocks; >+ >+use C4::Circulation; >+use C4::Letters; >+use utf8; >+use Koha::Database; >+ >+my $schema = Koha::Database->schema; >+$schema->storage->txn_begin(); >+ >+my $builder = t::lib::TestBuilder->new(); >+my $dbh = C4::Context->dbh; >+$dbh->do(q{INSERT INTO letter (module, code, name, title, content) VALUES ('test', 'TEST_MESSAGE','Test', '[% biblio.title %]', " >+---- >+<<biblio.title>> >+---- >+")}); >+my $biblio_1 = $builder->build_sample_biblio({ title => "heÃllo" }); >+my $biblio_2 = $builder->build_sample_biblio({ title => "hellâ¤ï¸" }); >+my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { email => 'test@example.org'} }); >+my $letter = C4::Letters::GetPreparedLetter( >+ ( >+ module => 'test', >+ letter_code => 'TEST_MESSAGE', >+ tables => { >+ biblio => $biblio_1->biblionumber, >+ }, >+ ) >+); >+ >+C4::Message->enqueue($letter, $patron->unblessed, 'email'); >+my $message = C4::Message->find_last_message($patron->unblessed, 'TEST_MESSAGE', 'email'); >+like( $message->{metadata}, qr{heÃllo} ); >+ >+$letter = C4::Letters::GetPreparedLetter( >+ ( >+ module => 'test', >+ letter_code => 'TEST_MESSAGE', >+ tables => { >+ biblio => $biblio_2->biblionumber, >+ }, >+ ) >+); >+$message->append($letter); >+#use Data::Printer colored => 1; warn p $content; >+like( $message->{metadata}, qr{heÃllo} ); >+like( $message->{metadata}, qr{hellâ¤ï¸} ); >+ >-- >2.20.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 28230
:
120196
|
120202
|
120203
|
120204
|
120210
|
120211
|
120227
|
120228
|
120230