|
Lines 3-9
Link Here
|
| 3 |
use strict; |
3 |
use strict; |
| 4 |
use warnings; |
4 |
use warnings; |
| 5 |
|
5 |
|
| 6 |
use Test::More tests => 5; |
6 |
use Test::More tests => 6; |
|
|
7 |
use Test::Warn; |
| 7 |
use CGI qw ( -utf8 ); |
8 |
use CGI qw ( -utf8 ); |
| 8 |
|
9 |
|
| 9 |
BEGIN { |
10 |
BEGIN { |
|
Lines 28-30
my $output = 'foobarbaz';
Link Here
|
| 28 |
like($stdout, qr/Cache-control: no-cache[^,]/, 'not using force_no_caching sets Cache-control as desired'); |
29 |
like($stdout, qr/Cache-control: no-cache[^,]/, 'not using force_no_caching sets Cache-control as desired'); |
| 29 |
unlike($stdout, qr/Expires: /, 'force_no_caching does not set an Expires header'); |
30 |
unlike($stdout, qr/Expires: /, 'force_no_caching does not set an Expires header'); |
| 30 |
} |
31 |
} |
| 31 |
- |
32 |
|
|
|
33 |
subtest 'parametrized_url' => sub { |
| 34 |
plan tests => 2; |
| 35 |
|
| 36 |
my $url = 'https://somesite.com/search?q={TITLE}&author={AUTHOR}{SUFFIX}'; |
| 37 |
my $subs = { TITLE => '_title_', AUTHOR => undef, ISBN => '123456789' }; |
| 38 |
my $res; |
| 39 |
warning_is { $res = C4::Output::parametrized_url( $url, $subs ) } |
| 40 |
q{}, 'No warning expected on undefined author'; |
| 41 |
is( $res, 'https://somesite.com/search?q=_title_&author=', |
| 42 |
'Title replaced, author empty and SUFFIX removed' ); |
| 43 |
}; |