http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10298
Jonathan Druart <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #18301|0 |1 is obsolete| | --- Comment #4 from Jonathan Druart <[email protected]> --- Created attachment 18504 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=18504&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. _______________________________________________ Koha-bugs mailing list [email protected] http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
