[Koha-bugs] [Bug 28615] Add a simple way to mock Koha::Logger

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Jun 23 02:04:34 CEST 2021


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

--- Comment #7 from David Cook <dcook at prosentient.com.au> ---
(In reply to Tomás Cohen Arazi from comment #6)
> Of course you need to recreate the conditions. But would you prefer to set
> the logger in the tests and verify the file was written? Or better mock like
> this and catch the warn?

I don't understand what you're asking here. I'd configure the logger to print
to STDERR and capture that. I actually did that recently although I'm having
trouble remembering where. I'll keep looking to see if I can find my example.

> The use case: you want to add a test (which is actually missing) to test
> C4::Acquisition::UpdateFine calls the logger with ->debug and passes some
> stuff to it. This is what I come up with. But I'm not attached to my ideas
> when better exist!

I'll take a look for my code snippet and see if it helps.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list