[TYPO3-mvc] viewhelpers: stripHTML & removeXSS - what should be tested?

Helmut Hummel typo3 at jhpc.de
Thu May 21 18:10:56 CEST 2009


Hi Andreas,

Am 20.05.2009 12:00 Uhr, schrieb Andreas Rieser:
>
> Am 20.05.2009 um 09:32 schrieb Helmut Hummel:
>
>> Aren't there testcases for removeXSS already? I think Steffen Kamper did
>> something about this?
>
> Yes, but no ^^ (look at his post)

Right, he did not implement it as unit tests, but I think it points to 
the direction what unit test should do when testing a function like 
removeXSS.

>> Anyway, the view helper should call the t3lib_div function so the test
>> belongs there, not into fluid.
>> Regards Helmut
>
> So there shouldn't be any test to make sure that this call actually works?

So you want to simply write a test, that t3lib_div::removeXSS is called, 
no matter what the function call returns? I think this would be possible.

> And what about stripHTML - I mean it is just using one basic php
> function - the same for that?

Testing the output of strip_tags()? I'm no expert in unit testing, but 
this test seems obsolete to me.

When thinking about this, I now wonder if stripHTML and removeXSS should 
be implemented as view helpers at all.

Probably this belongs to the property validation framework, doesn't it?

Kind regards
Helmut


More information about the TYPO3-project-typo3v4mvc mailing list