https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28615

Kyle M Hall <k...@bywatersolutions.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #122484|0                           |1
        is obsolete|                            |
 Attachment #122485|0                           |1
        is obsolete|                            |

--- Comment #27 from Kyle M Hall <k...@bywatersolutions.com> ---
Created attachment 122488
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122488&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 <tomasco...@theke.io>
Signed-off-by: Martin Renvoize <martin.renvo...@ptfs-europe.com>

Signed-off-by: Kyle M Hall <k...@bywatersolutions.com>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/

Reply via email to