From a874e486912c1ca66e79af3afe30c030a7493ea0 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 18 Mar 2020 10:07:02 +0100 Subject: [PATCH] Bug 22823: Rename method with ->inbound_email_address Make the name obvious it's not an email address for "from" Signed-off-by: Jonathan Druart --- Koha/Library.pm | 6 +++--- t/db_dependent/Koha/Libraries.t | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Koha/Library.pm b/Koha/Library.pm index 965de87404..697c745c5b 100644 --- a/Koha/Library.pm +++ b/Koha/Library.pm @@ -65,15 +65,15 @@ sub get_effective_marcorgcode { return $self->marcorgcode || C4::Context->preference("MARCOrgCode"); } -=head3 get_effective_email +=head3 inbound_email_address - my $to_email = Koha::Library->get_effective_email; + my $to_email = Koha::Library->inbound_email_address; Returns an effective email address which should be accessible to librarians at the branch. =cut -sub get_effective_email { +sub inbound_email_address { my ($self) = @_; return diff --git a/t/db_dependent/Koha/Libraries.t b/t/db_dependent/Koha/Libraries.t index 874b3a316b..478388917b 100644 --- a/t/db_dependent/Koha/Libraries.t +++ b/t/db_dependent/Koha/Libraries.t @@ -452,7 +452,7 @@ subtest '->get_effective_marcorgcode' => sub { $schema->storage->txn_rollback; }; -subtest '->get_effective_email' => sub { +subtest '->inbound_email_address' => sub { plan tests => 4; @@ -471,19 +471,19 @@ subtest '->get_effective_email' => sub { 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, + is( $library_1->inbound_email_address, $library_1->branchreplyto, 'If defined, use branches replyto address'); $library_1->branchreplyto(undef)->store(); - is( $library_1->get_effective_email, $library_1->branchemail, + is( $library_1->inbound_email_address, $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', + is( $library_1->inbound_email_address, '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', + is( $library_1->inbound_email_address, 'admin@mylibrary.com', 'Fallback to KohaAdminEmailAddress email address when branchreplyto, branchemail and eplytoDefault are undefined'); $schema->storage->txn_rollback; -- 2.20.1