Bugzilla – Attachment 73210 Details for
Bug 20422
Fix warn on URI/Escape.pm line 184 from opac-detail
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20422: Add unit test to Output.t for parametrized_url
Bug-20422-Add-unit-test-to-Outputt-for-parametrize.patch (text/plain), 1.65 KB, created by
Nick Clemens (kidclamp)
on 2018-03-23 17:11:22 UTC
(
hide
)
Description:
Bug 20422: Add unit test to Output.t for parametrized_url
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2018-03-23 17:11:22 UTC
Size:
1.65 KB
patch
obsolete
>From 7c6060cd42076c90d88c6e2d134b6518a25ac988 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 15 Mar 2018 14:07:11 +0100 >Subject: [PATCH] Bug 20422: Add unit test to Output.t for parametrized_url > >This test will reveal that we need to resolve a warning too. > >Test plan: >[1] Run t/Output.t without the second patch. >[2] The test will fail on the warning raised by an undefined value. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/Output.t | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > >diff --git a/t/Output.t b/t/Output.t >index 4474d18..279ce06 100755 >--- a/t/Output.t >+++ b/t/Output.t >@@ -3,7 +3,8 @@ > use strict; > use warnings; > >-use Test::More tests => 5; >+use Test::More tests => 6; >+use Test::Warn; > use CGI qw ( -utf8 ); > > BEGIN { >@@ -28,3 +29,15 @@ my $output = 'foobarbaz'; > like($stdout, qr/Cache-control: no-cache[^,]/, 'not using force_no_caching sets Cache-control as desired'); > unlike($stdout, qr/Expires: /, 'force_no_caching does not set an Expires header'); > } >+ >+subtest 'parametrized_url' => sub { >+ plan tests => 2; >+ >+ my $url = 'https://somesite.com/search?q={TITLE}&author={AUTHOR}{SUFFIX}'; >+ my $subs = { TITLE => '_title_', AUTHOR => undef, ISBN => '123456789' }; >+ my $res; >+ warning_is { $res = C4::Output::parametrized_url( $url, $subs ) } >+ q{}, 'No warning expected on undefined author'; >+ is( $res, 'https://somesite.com/search?q=_title_&author=', >+ 'Title replaced, author empty and SUFFIX removed' ); >+}; >-- >2.1.4
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 20422
:
72952
|
72953
|
72954
|
72955
| 73210 |
73211