Bugzilla – Attachment 174869 Details for
Bug 38501
Prevent failures of Koha/Booking.t when running tests on an updated database
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38501: Prevent failures of Koha/Booking.t when run on MySQL8
Bug-38501-Prevent-failures-of-KohaBookingt-when-ru.patch (text/plain), 4.31 KB, created by
Paul Derscheid
on 2024-11-21 10:02:41 UTC
(
hide
)
Description:
Bug 38501: Prevent failures of Koha/Booking.t when run on MySQL8
Filename:
MIME Type:
Creator:
Paul Derscheid
Created:
2024-11-21 10:02:41 UTC
Size:
4.31 KB
patch
obsolete
>From c9a481006fd5ba65a7e84ec0d5ac54340a260232 Mon Sep 17 00:00:00 2001 >From: Paul Derscheid <paul.derscheid@lmscloud.de> >Date: Thu, 21 Nov 2024 10:01:56 +0000 >Subject: [PATCH] Bug 38501: Prevent failures of Koha/Booking.t when run on > MySQL8 > >--- > t/db_dependent/Koha/Booking.t | 70 +++++++++++++++++++++++++++++++++++ > 1 file changed, 70 insertions(+) > >diff --git a/t/db_dependent/Koha/Booking.t b/t/db_dependent/Koha/Booking.t >index 19aa536b12..3e17810870 100755 >--- a/t/db_dependent/Koha/Booking.t >+++ b/t/db_dependent/Koha/Booking.t >@@ -25,6 +25,8 @@ use Test::More tests => 2; > use Test::Exception; > > use Koha::DateUtils qw( dt_from_string ); >+use Koha::Notice::Template; >+use Koha::Notice::Templates; > > use t::lib::TestBuilder; > use t::lib::Mocks; >@@ -369,6 +371,39 @@ subtest 'store() tests' => sub { > subtest 'confirmation notice trigger' => sub { > plan tests => 2; > >+ # FIXME: This is a bandaid solution to prevent test failures on MySQL8 where notices are >+ # not added at upgrade time. >+ my $template = Koha::Notice::Templates->search( >+ { >+ module => 'bookings', >+ code => 'BOOKING_CONFIRMATION', >+ message_transport_type => 'email', >+ } >+ )->single; >+ >+ if ( !$template ) { >+ my $default_content = Koha::Notice::Template->new( >+ { >+ module => 'bookings', >+ code => 'BOOKING_CONFIRMATION', >+ lang => 'default', >+ message_transport_type => 'email', >+ } >+ )->get_default(); >+ >+ Koha::Notice::Template->new( >+ { >+ module => 'bookings', >+ code => 'BOOKING_CONFIRMATION', >+ name => 'BOOKING_CONFIRMATION Test Notice', >+ title => 'BOOKING_CONFIRMATION Test Notice', >+ content => $default_content || 'Dummy content for BOOKING_CONFIRMATION.', >+ branchcode => undef, >+ message_transport_type => 'email', >+ } >+ )->store; >+ } >+ > my $original_notices_count = Koha::Notice::Messages->search( > { > letter_code => 'BOOKING_CONFIRMATION', >@@ -420,6 +455,41 @@ subtest 'store() tests' => sub { > subtest 'modification/cancellation notice triggers' => sub { > plan tests => 5; > >+ # FIXME: This is a bandaid solution to prevent test failures on MySQL8 where notices are >+ # not added at upgrade time. >+ for my $notice_type (qw(BOOKING_MODIFICATION BOOKING_CANCELLATION)) { >+ my $template = Koha::Notice::Templates->search( >+ { >+ module => 'bookings', >+ code => $notice_type, >+ message_transport_type => 'email', >+ } >+ )->single; >+ >+ unless ($template) { >+ my $default_content = Koha::Notice::Template->new( >+ { >+ module => 'bookings', >+ code => $notice_type, >+ lang => 'default', >+ message_transport_type => 'email', >+ } >+ )->get_default(); >+ >+ Koha::Notice::Template->new( >+ { >+ module => 'bookings', >+ code => $notice_type, >+ name => "$notice_type Test Notice", >+ title => "$notice_type Test Notice", >+ content => $default_content || "Dummy content for $notice_type.", >+ branchcode => undef, >+ message_transport_type => 'email', >+ } >+ )->store; >+ } >+ } >+ > my $original_modification_notices_count = Koha::Notice::Messages->search( > { > letter_code => 'BOOKING_MODIFICATION', >-- >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 38501
:
174869
|
174870