Bugzilla – Attachment 100934 Details for
Bug 22823
Koha::Library needs a method for obtaining the inbound email address
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22823: Add unit tests for get_effective_email
Bug-22823-Add-unit-tests-for-geteffectiveemail.patch (text/plain), 2.42 KB, created by
Jonathan Druart
on 2020-03-18 09:48:48 UTC
(
hide
)
Description:
Bug 22823: Add unit tests for get_effective_email
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-03-18 09:48:48 UTC
Size:
2.42 KB
patch
obsolete
>From 5d5a92b54f99f15c7f130d3767b3ae946c8479a7 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 25 Feb 2020 07:36:12 +0000 >Subject: [PATCH] Bug 22823: Add unit tests for get_effective_email > >This patch adds unit tests for the newly introduced get_effective_email >method in the Koha::Library class. > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/Koha/Libraries.t | 39 ++++++++++++++++++++++++++++++++- > 1 file changed, 38 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Libraries.t b/t/db_dependent/Koha/Libraries.t >index 7c3cd78eff..874b3a316b 100644 >--- a/t/db_dependent/Koha/Libraries.t >+++ b/t/db_dependent/Koha/Libraries.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 9; >+use Test::More tests => 10; > > use C4::Biblio; > use C4::Context; >@@ -452,6 +452,43 @@ subtest '->get_effective_marcorgcode' => sub { > $schema->storage->txn_rollback; > }; > >+subtest '->get_effective_email' => sub { >+ >+ plan tests => 4; >+ >+ $schema->storage->txn_begin; >+ >+ my $library_1 = $builder->build_object( >+ { >+ class => 'Koha::Libraries', >+ value => { >+ branchemail => 'from@mybranc.com', >+ branchreplyto => 'reply@mybranch.com' >+ } >+ } >+ ); >+ >+ t::lib::Mocks::mock_preference( 'KohaAdminEmailAddress', 'admin@mylibrary.com' ); >+ t::lib::Mocks::mock_preference( 'ReplytoDefault', 'reply@mylibrary.com' ); >+ >+ is( $library_1->get_effective_email, $library_1->branchreplyto, >+ 'If defined, use branches replyto address'); >+ >+ $library_1->branchreplyto(undef)->store(); >+ is( $library_1->get_effective_email, $library_1->branchemail, >+ 'Fallback to branches email address when branchreplyto is undefined'); >+ >+ $library_1->branchemail(undef)->store(); >+ is( $library_1->get_effective_email, 'reply@mylibrary.com', >+ 'Fallback to ReplytoDefault email address when branchreplyto and branchemail are undefined'); >+ >+ t::lib::Mocks::mock_preference( 'ReplytoDefault', undef ); >+ is( $library_1->get_effective_email, 'admin@mylibrary.com', >+ 'Fallback to KohaAdminEmailAddress email address when branchreplyto, branchemail and eplytoDefault are undefined'); >+ >+ $schema->storage->txn_rollback; >+}; >+ > subtest 'cash_registers' => sub { > plan tests => 3; > >-- >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 22823
:
99539
|
99554
|
99555
|
99726
|
99728
| 100934 |
100935
|
100936
|
100937