View | Details | Raw Unified | Return to bug 12398
Collapse All | Expand All

(-)a/t/db_dependent/Auth_with_cas.t (-6 / +38 lines)
Lines 1-16 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
3
use Modern::Perl;
18
use Modern::Perl;
4
19
5
use Test::More tests => 2;
20
use Test::More tests => 3;
6
use CGI;
21
use CGI;
7
22
8
use C4::Context;
23
use C4::Context;
9
24
10
BEGIN {
25
BEGIN {
11
        use_ok('C4::Auth_with_cas');
26
    use_ok('C4::Auth_with_cas');
27
    can_ok('C4::Auth_with_cas', qw/
28
            check_api_auth_cas
29
            checkpw_cas
30
            login_cas
31
            logout_cas
32
            login_cas_url
33
            /);
12
}
34
}
13
35
36
my $dbh = C4::Context->dbh;
37
# Start transaction
38
$dbh->{ AutoCommit } = 0;
39
$dbh->{ RaiseError } = 1;
40
41
C4::Context->set_preference('OPACBaseURL','localhost');
42
14
my $opac_base_url = C4::Context->preference('OpacBaseURL');
43
my $opac_base_url = C4::Context->preference('OpacBaseURL');
15
my $query_string = 'ticket=foo&bar=baz';
44
my $query_string = 'ticket=foo&bar=baz';
16
45
Lines 20-26 $ENV{SCRIPT_NAME} = '/cgi-bin/koha/opac-user.pl'; Link Here
20
my $cgi = new CGI($query_string);
49
my $cgi = new CGI($query_string);
21
$cgi->delete('ticket');
50
$cgi->delete('ticket');
22
51
23
# _url_with_get_params should return the URL without 'ticket' parameter since it
52
# _url_with_get_params tests
24
# has been deleted.
25
is(C4::Auth_with_cas::_url_with_get_params($cgi),
53
is(C4::Auth_with_cas::_url_with_get_params($cgi),
26
    "$opac_base_url/cgi-bin/koha/opac-user.pl?bar=baz");
54
    "$opac_base_url/cgi-bin/koha/opac-user.pl?bar=baz",
55
   "_url_with_get_params should return URL without deleted parameters (Bug 12398)");
56
57
$dbh->rollback;
58
59
1;
27
- 

Return to bug 12398