From 300bf096bda90a0f17c6615798957fa7f588b36e Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Wed, 23 Mar 2016 14:07:09 +0100 Subject: [PATCH] Bug 16134: t::lib::Mocks::mock_preference should be case-insensitive Test plan: 1. prove t/db_dependent/Auth_with_cas.t => FAIL 2. Apply patch 3. prove t/db_dependent/Auth_with_cas.t => SUCCESS Signed-off-by: Jonathan Druart Signed-off-by: Katrin Fischer Signed-off-by: Brendan A Gallagher --- t/lib/Mocks.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/t/lib/Mocks.pm b/t/lib/Mocks.pm index 22ac6593f2..46a87cb799 100644 --- a/t/lib/Mocks.pm +++ b/t/lib/Mocks.pm @@ -24,11 +24,14 @@ sub mock_config { my %preferences; sub mock_preference { - my $context = new Test::MockModule('C4::Context'); my ( $pref, $value ) = @_; - $preferences{$pref} = $value; + + $preferences{lc($pref)} = $value; + + my $context = new Test::MockModule('C4::Context'); $context->mock('preference', sub { my ( $self, $pref ) = @_; + $pref = lc($pref); if ( exists $preferences{$pref} ) { return $preferences{$pref} } else { -- 2.39.5