From 443b1a6585ff6ad6553449115d6f2e66eeb72920 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Wed, 30 Jul 2014 14:45:04 +0200 Subject: [PATCH] Bug 12398: Use mocks to make the test "database independent" --- t/Auth_with_cas.t | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/t/Auth_with_cas.t b/t/Auth_with_cas.t index 0b4a692..4ad949a 100755 --- a/t/Auth_with_cas.t +++ b/t/Auth_with_cas.t @@ -5,8 +5,11 @@ use Test::More tests => 1; use CGI; use C4::Auth_with_cas; +use t::lib::Mocks; + +my $opac_base_url = 'http://opacbaseurl'; +t::lib::Mocks::mock_preference('OPACBaseURL', $opac_base_url); -my $opac_base_url = C4::Context->preference('OpacBaseURL'); my $query_string = 'ticket=foo&bar=baz'; $ENV{QUERY_STRING} = $query_string; @@ -18,4 +21,5 @@ $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"); + "$opac_base_url/cgi-bin/koha/opac-user.pl?bar=baz", + "_url_with_get_params should return URL without deleted parameters (Bug 12398)"); -- 1.7.10.4