How do I test a class that has private methods, fields or inner classes? How do I use JUnit to test a class that has internal private methods, fields or nested classes? It seems bad to change the access modifier for a method just to be able to run a test. Solution: If you have somewhat of a legacy application, and you're not allowed to change the visibility of your methods, the best way to test private methods is to use reflection. Internally we're
undefined
SimpleTest vs PHPunit I was wondering if anyone that have experience in both these stuff can shed some light on the significant difference between the two, if any? Any specific strength of each that makes it suitable for any specific case? Answer: This question is quite dated but as it is still getting traffic and answers I though I state my point here again even so I already did it on some other (newer) questions. I'm really really baffled that SimpleTest still is considered an alternative to phpunit. Maybe