[Koha-bugs] [Bug 17770] t/db_dependent/ Sitemapper.t fails when date changes during test run

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Dec 15 17:29:26 CET 2017


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

--- Comment #10 from M. Tompsett <mtompset at hotmail.com> ---
(In reply to Marcel de Rooy from comment #9)
> You are mocking now while there is only one call left. Why not just call
> DateTime->now only once to fill $now ? First getting the complete date and
> then extracting ymd later is unneeded?

Yes, only 85 directly uses it. However, there are tests on
lines 71, 83, 97, 100, 116, 129, 145, 154, 164, 182, 185, 193, 196, and 204.

Any of these that trigger DateTime->now()->ymd on line 109 of
Koha::SiteMapper::Writer needs the mock. Otherwise the end tag won't match.

I added a nice print STDERR "TRIGGERED!\n"; just about it and determined that
the tests 4, 8, and 11 use it. This means this mock will fix not just test 12's
more typical failure, but even the rarest cases of 5 and 9.

Plus, I was implementing exactly what was suggested in comment #0 by Katrin
Fischer.

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


More information about the Koha-bugs mailing list