[Koha-bugs] [Bug 10298] t::lib::Mocks tries to deal with syspref but doesn not manage to
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Wed May 22 11:07:46 CEST 2013
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10298
--- Comment #1 from Jonathan Druart <jonathan.druart at biblibre.com> ---
Created attachment 18301
-->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=18301&action=edit
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.
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list