http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10298 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19009|0 |1 is obsolete| | --- Comment #10 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 20206 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=20206&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. Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.