From 513657b09a00934009f77adaf2c31fdea98ecce7 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 Signed-off-by: Tomas Cohen Arazi Signed-off-by: Pedro Amorim Signed-off-by: Katrin Fischer --- 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 980fce5bcd..3d0214f055 100644 --- a/Koha/Illrequest.pm +++ b/Koha/Illrequest.pm @@ -761,7 +761,7 @@ sub custom_capability { request => $self, other => $params, }); - return $self->expandTemplate($response); + return $self->expand_template($response); } } return 0; @@ -826,7 +826,7 @@ sub backend_illview { request => $self, other => $params, }); - return $self->expandTemplate($response) if $response; + return $self->expand_template($response) if $response; return $response; } @@ -844,7 +844,7 @@ sub backend_migrate { request => $self, other => $params, }); - return $self->expandTemplate($response) if $response; + return $self->expand_template($response) if $response; return $response; } @@ -869,7 +869,7 @@ sub backend_confirm { request => $self, other => $params, }); - return $self->expandTemplate($response); + return $self->expand_template($response); } =head3 backend_update_status @@ -878,7 +878,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 @@ -897,7 +897,7 @@ sub backend_cancel { other => $params }); - return $self->expandTemplate($result); + return $self->expand_template($result); } =head3 backend_renew @@ -910,7 +910,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, }) @@ -972,7 +972,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! @@ -1005,7 +1005,7 @@ sub backend_create { $result = $unmediated_result if $unmediated_result; } - return $self->expandTemplate($result); + return $self->expand_template($result); } =head3 backend_get_update @@ -1030,15 +1030,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.39.5