Lines 1-14
Link Here
|
1 |
#!/usr/bin/perl |
1 |
#!/usr/bin/perl |
2 |
# |
|
|
3 |
# This Koha test module is a stub! |
4 |
# Add more tests here!!! |
5 |
|
2 |
|
6 |
use strict; |
3 |
use Modern::Perl; |
7 |
use warnings; |
|
|
8 |
|
4 |
|
9 |
use Test::More tests => 1; |
5 |
use Test::More tests => 2; |
|
|
6 |
use CGI; |
7 |
|
8 |
use C4::Context; |
10 |
|
9 |
|
11 |
BEGIN { |
10 |
BEGIN { |
12 |
use_ok('C4::Auth_with_cas'); |
11 |
use_ok('C4::Auth_with_cas'); |
13 |
} |
12 |
} |
14 |
|
13 |
|
15 |
- |
14 |
my $opac_base_url = C4::Context->preference('OpacBaseURL'); |
|
|
15 |
my $query_string = 'ticket=foo&bar=baz'; |
16 |
|
17 |
$ENV{QUERY_STRING} = $query_string; |
18 |
$ENV{SCRIPT_NAME} = '/cgi-bin/koha/opac-user.pl'; |
19 |
|
20 |
my $cgi = new CGI($query_string); |
21 |
$cgi->delete('ticket'); |
22 |
|
23 |
# _url_with_get_params should return the URL without 'ticket' parameter since it |
24 |
# has been deleted. |
25 |
is(C4::Auth_with_cas::_url_with_get_params($cgi), |
26 |
"$opac_base_url/cgi-bin/koha/opac-user.pl?bar=baz"); |