[dev] Kronolith_Integration_ToIcalendarTest and dealing with recurrence exceptions
Gunnar Wrobel
wrobel at horde.org
Sat Jun 25 05:04:33 UTC 2011
Hi!
I started converting more of our application test suites to PHPUnit
and I am currently focusing on Kronolith. The test mentioned above
("Kronolith_Integration_ToIcalendarTest") is hard to convert from the
Horde 3 version because of the way recurrence exceptions are handled.
You can disable the "markTestIncomplete()" in the "ToIcalendarTest" in
order to see what I refer to. The problem is caused by the section
that handles recurrence exceptions in the
Kronolith_Event::toiCalendar() function.
This sections fetches a complete driver and searches for the "baseid".
"baseid" however seems to work only with the SQL backend. Which I
would like to avoid as the amount of setup code - even if done in
SQLite - is much more complex and it seems unnecessary to simply
export an event to iCal. So I tried using a mock "Ical" driver instead
but that one fails because the search function is unhappy about the
missing stdClass->start and ->end properties. So my impression is that
this section is only meant to be valid for the SQL backend and then it
would be strange to find it in Kronolith_Event.
I assume the fact that the event needs to query the driver again is an
optimization to lazy load the recurrence exceptions only in case they
are required. I'd be tempted to convert that into a callback function
that gets set in the constructor and allows the event to query the
recurrence exceptions from the driver on demand.
But I'm obviously not deep enough into the code, so maybe someone
could give me some directions. If absolutely required I can also live
with a test based on SQLite. Will have to be done for Kronolith sooner
or later anyhow. But of course aiming for light weight tests is always
better if possible.
Cheers,
Gunnar
--
Core Developer
The Horde Project
e: wrobel at horde.org
t: +49 700 6245 0000
w: http://www.horde.org
pgp: 9703 43BE
tweets: http://twitter.com/pardus_de
blog: http://log.pardus.de
More information about the dev
mailing list