Two corrections to things I said in this thread:
- on March 15 I said to Karthik: a TestHelper class is to help testing a class from the outside, making testing more "transparent". That is nonsense. Sorry for confusion. A TestHelper is just a class to help testing, nothing more, nothing less.
- I went some time on the same road with Garymort in this thread saying "I /need/ to know what some of these private methods are expected to return so I can decide whether to use/extend them or not". I just realised, that I always saw private methods as not overridable, but that it still would be possible to use them in your own extension. That, however is not the case: you cannot call a private method in your extension of a class! Of course you can circumvent that scope using reflection or other tricks (like calling the private method in another instance of the same superclass and using it in a protected or public method of that subclass), but that is not why we limit the scope of a method. Developers don't use the private method in their extensions. I'd be very intersted in counter-examples; they are probably an indication of a problem.
Last week Karthik added another test to a private method of the cache package. Some discussion about it here: https://github.com/joomla-framework/cache/pull/3
Those tests for private methods can be a nice concrete example to use in this discussion. It prevents us from staying in theoretical or academic examples.