From beebbfebbe205ab81fa71149e53a0a06e61b7258 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Wed, 30 Jul 2014 14:02:11 +0200 Subject: [PATCH] Bug 12398: Add test for C4::Auth_with_cas::_url_with_get_params Run `prove t/Auth_with_cas.t` to run the test --- t/Auth_with_cas.t | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 t/Auth_with_cas.t diff --git a/t/Auth_with_cas.t b/t/Auth_with_cas.t new file mode 100755 index 0000000..0b4a692 --- /dev/null +++ b/t/Auth_with_cas.t @@ -0,0 +1,21 @@ +#!/usr/bin/perl + +use Modern::Perl; +use Test::More tests => 1; + +use CGI; +use C4::Auth_with_cas; + +my $opac_base_url = C4::Context->preference('OpacBaseURL'); +my $query_string = 'ticket=foo&bar=baz'; + +$ENV{QUERY_STRING} = $query_string; +$ENV{SCRIPT_NAME} = '/cgi-bin/koha/opac-user.pl'; + +my $cgi = new CGI($query_string); +$cgi->delete('ticket'); + +# _url_with_get_params should return the URL without 'ticket' parameter since it +# has been deleted. +is(C4::Auth_with_cas::_url_with_get_params($cgi), + "$opac_base_url/cgi-bin/koha/opac-user.pl?bar=baz"); -- 1.7.10.4