From f8e0aef887b99a3a5e4b7c035eae1d0ba2d0fe6a Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Mon, 30 Oct 2023 12:22:52 +0000 Subject: [PATCH] Bug 19605: Update expandTemplate to expand_template method name Signed-off-by: David Nind --- Koha/Illrequest.pm | 24 ++++++++++++------------ t/db_dependent/Illrequests.t | 6 +++--- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm index 831d6fa52d..2ca9569535 100644 --- a/Koha/Illrequest.pm +++ b/Koha/Illrequest.pm @@ -760,7 +760,7 @@ sub custom_capability { request => $self, other => $params, }); - return $self->expandTemplate($response); + return $self->expand_template($response); } } return 0; @@ -825,7 +825,7 @@ sub backend_illview { request => $self, other => $params, }); - return $self->expandTemplate($response) if $response; + return $self->expand_template($response) if $response; return $response; } @@ -843,7 +843,7 @@ sub backend_migrate { request => $self, other => $params, }); - return $self->expandTemplate($response) if $response; + return $self->expand_template($response) if $response; return $response; } @@ -868,7 +868,7 @@ sub backend_confirm { request => $self, other => $params, }); - return $self->expandTemplate($response); + return $self->expand_template($response); } =head3 backend_update_status @@ -877,7 +877,7 @@ sub backend_confirm { sub backend_update_status { my ( $self, $params ) = @_; - return $self->expandTemplate($self->_backend->update_status($params)); + return $self->expand_template($self->_backend->update_status($params)); } =head3 backend_cancel @@ -896,7 +896,7 @@ sub backend_cancel { other => $params }); - return $self->expandTemplate($result); + return $self->expand_template($result); } =head3 backend_renew @@ -909,7 +909,7 @@ The standard interface method allowing for request renewal queries. sub backend_renew { my ( $self ) = @_; - return $self->expandTemplate( + return $self->expand_template( $self->_backend->renew({ request => $self, }) @@ -960,7 +960,7 @@ sub backend_create { # ... simple case: we're not at 'commit' stage. my $stage = $result->{stage}; - return $self->expandTemplate($result) + return $self->expand_template($result) unless ( 'commit' eq $stage ); # ... complex case: commit! @@ -993,7 +993,7 @@ sub backend_create { $result = $unmediated_result if $unmediated_result; } - return $self->expandTemplate($result); + return $self->expand_template($result); } =head3 backend_get_update @@ -1018,15 +1018,15 @@ sub backend_get_update { return $response; } -=head3 expandTemplate +=head3 expand_template - my $params = $abstract->expandTemplate($params); + my $params = $abstract->expand_template($params); Return a version of $PARAMS augmented with our required template path. =cut -sub expandTemplate { +sub expand_template { my ( $self, $params ) = @_; my $backend = $self->_backend->name; # Generate path to file to load diff --git a/t/db_dependent/Illrequests.t b/t/db_dependent/Illrequests.t index bf1d6e7bf1..a5516b2850 100755 --- a/t/db_dependent/Illrequests.t +++ b/t/db_dependent/Illrequests.t @@ -723,15 +723,15 @@ subtest 'Backend core methods' => sub { # Now load the mocked backend $illrq->_backend($backend); - # expandTemplate: - is_deeply($illrq->expandTemplate({ test => 1, method => "bar" }), + # expand_template: + is_deeply($illrq->expand_template({ test => 1, method => "bar" }), { test => 1, method => "bar", template => "/tmp/Mock/intra-includes/bar.inc", opac_template => "/tmp/Mock/opac-includes/bar.inc", }, - "ExpandTemplate"); + "expand_template"); # backend_create # we are testing simple cases. -- 2.30.2