Bug 10298: Mock C4::Context->preference

t::lib::Mocks::Context tried to deal with preferences but did not manage
to.

This patch removes this module and add 2 routines in t::lib::Mocks in
order to mock C4::context->preference and C4::Context->config.

To test:

===START t/test.pl===

use Modern::Perl;
use t::lib::Mocks;
use C4::Context;

say "initial value for version: " . C4::Context->preference('Version');
say "initial value for language: " . C4::Context->preference('language');
t::lib::Mocks::mock_preference('Version', "new version for testing");
say "version is mocked with: " . C4::Context->preference('Version');
say "language is not yet mocked: " . C4::Context->preference('language');
t::lib::Mocks::mock_preference('language', 'new langage for testing');
t::lib::Mocks::mock_preference('Version', 'another version for testing');
say "version is mocked with another value: " . C4::Context->preference('Version');
say "language is finally mocked: " . C4::Context->preference('language');
===END===

Try to execute this file and check that the output is consistent.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10298: Followup: Adapt existing code

This unit tests file does not need the t::lib::Mocks::Context module.

To test:

prove t/db_dependent/Circulation_issuingrules.t

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, test checks out.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10298: Adapt existing code

set_solr and set_zebra is not really useful. It is preferable to use
mock_preference directly.

To test:
1/ Launch Solr
2/ prove -r t/searchengine/
It should produce:
% prove -r t/searchengine/
t/searchengine/000_conn/conn.t ........... ok
t/searchengine/001_search/search_base.t .. ok
t/searchengine/002_index/index_base.t .... IndexRecord called with biblio 2
Indexing biblio 2
t/searchengine/002_index/index_base.t .... ok
t/searchengine/003_query/buildquery.t .... ok
t/searchengine/004_config/load_config.t .. ok
All tests successful.
Files=5, Tests=21,  4 wallclock secs ( 0.03 usr  0.01 sys +  2.74 cusr
0.20 csys =  2.98 CPU)
Result: PASS

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Had to get Solr going again to test this, man .. they could make that
easier

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>