https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28615
Martin Renvoize <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #122480|0 |1 is obsolete| | --- Comment #24 from Martin Renvoize <[email protected]> --- Created attachment 122484 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122484&action=edit Bug 28615: Add a simple way to mock Koha::Logger This patch introduces a new way to mock and test Koha::Logger. As the POD says, it is used by calling my $logger = t::lib::Mocks::Logger->new(); It then provides convenient methods for testing the logging itself per log-level: * warn_is * warn_like * debug_is * debug_like ... Methods for counting the logging activity and also for clearing the mock buffer are provided as well. This is covered in the POD and also on the follow-up, that makes use of this to fix Auth_with_shibboleth.t To test: 1. Run: $ kshell k$ prove t/Auth_with_shibboleth.t => FAIL: Tests fail! It expects some warns but they are not returned by the lib 2. Apply this patches 3. Repeat 1 => SUCCESS: Tests pass! The tests now use the new lib, and they correctly find the logging Auth_with_shibboleth.pm does on function calls. 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <[email protected]> Signed-off-by: Martin Renvoize <[email protected]> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://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/
