[TYPO3-core] RFC #11431: Hook request for manipulating the pageID in getPage

Oliver Hader oliver at typo3.org
Fri Aug 28 17:38:35 CEST 2009


Hi Christian,

Christian Kuhn schrieb:
> Hey,
> 
> Oliver Hader wrote:
>>> Steffen Kamper wrote:
>>>> +1 on reading. I applied and saw no error, but i didn't wrote a
>>>> testhook for this. As the hook is defined like the other ones a
>>>> expect the hook working.
>>> Thanks! Yep, hooks are usually hard to test in a useful matter. In this
>>> case I would like to bend the rules a tiny bit and commit this one in 72
>>> hours if nobody objects meanwhile, even without the missing +1 on
>>> testing. Please stand up now.
>>>
>>> This hook is working and used in a production environment for quite some
>>> time, but it would take me at least two hours to set up a really useful
>>> test extension and environment.
>>>
>>> I'll also forward this message explicitly to Oliver, so the RM has a
>>> chance to veto my egoistic decision.
>>
>> Thanks for your reminder. I see that it is a problem that RFCs are not
>> tested enough and thus are blocked from being integrated into the Core.
>> This problem could be solved by using unit tests as much as possible. In
>> this case it would be possible to use a mock and check whether the hook
>> method gets called with the expected values.
>>
>> I'm going to have a look later this day and could possibly also create
>> that test case...
> 
> Attached a testcase for this hook, similar for what Oliver has done for
> #9292
> 
> I hope this will lead to the missing +1 on testing from a core dev ;)

Thanks for providing a unit test that looks good so far.
Thus: +1 on testing

However, I have some remarks concerning the patch:
1) it's not said that the hook is only used for manipulating the page
uid, other things could be checked, too
-> I'd prefer something like getPage_preProcess instead of manipulatePageUid
2) If you call a specific method in the hook object, it should implement
a given interface (e.g. look to tslib/interfaces/ to see how they are
used) - otherwise you could also use the callUserFunc alternative that
allows one to define the method to be called

olly
-- 
Oliver Hader
TYPO3 Release Manager 4.3


More information about the TYPO3-team-core mailing list