[Solar-talk] Solar Testing via external test library
Travis Swicegood
development at domain51.com
Wed Oct 4 11:19:50 PDT 2006
Antti Holvikari wrote:
> On 10/4/06, Rodrigo Moraes <rodrigo.moraes at gmail.com> wrote:
>
>> On 10/4/06, Antti Holvikari wrote:
>>
>>> I'm
>>> not an expert of this area but sometimes I wish I could test private
>>> methods, is that possible with SimpleTest?
>>>
>> I've read somewhere this is possible with PhpUnit3.
>>
>
> Yes, I guess reflection or runkit would enable this.
>
You can do this in PHP5 via an adatper that overrides a class and passes
everything through __call(). That said, if you need to test your
private method, it's doing too much. Actually, privates are a great
idea for that very reason, you can't test them. Now, if you have a
private that relies on another object/function that is tested then
that's another story.
But this is a discussion for another mailing list :-)
-Travis
More information about the solar-talk
mailing list