Re:PHP Sadness
by arkh on Thursday November 29, 2018 @08:32AM
(#18560012)
If you can't put the thing you're testing (method, class, application) in the state you want to test using only public methods you are not testing something useful. If you're doing to get 100% coverage be happy: that's dead code you can remove.
[ Parent
| on HN ]
Counterexample: Testing something that uses your language's Array.shuffle equivalent which doesn't expose the randomness provider. You can't put it in the right state without just stubbing the call and making it return the order you want.