From fd43d29a5730248860f70cd9dd5755bdf263ad20 Mon Sep 17 00:00:00 2001
From: Julian Maurice <julian.maurice@biblibre.com>
Date: Wed, 23 Mar 2016 14:07:09 +0100
Subject: [PATCH] [PASSED QA] 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 <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
---
 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 22ac659..46a87cb 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 {
-- 
1.9.1