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

--- Comment #6 from Tomás Cohen Arazi <[email protected]> ---
(In reply to David Cook from comment #5)
> (In reply to Tomás Cohen Arazi from comment #4)
> > (In reply to David Cook from comment #3)
> > > Why do we need to mock the logger? 
> > > 
> > > Regarding log permissions, we'd just need to make sure to pass it the 
> > > right
> > > configuration. 
> > > 
> > > I don't see why mocking would help in terms of testing $logger->debug 
> > > calls?
> > 
> > How would you test a function call added a warning under certain conditions?
> 
> I'd re-create those certain conditions. I can understand mocking a
> third-party integration, but I don't see why it would be needed for the
> logger.

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?

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!

-- 
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/

Reply via email to