Should you test private methods?

While trying to learn TDD I found myself asking this question fairly often. I’ve searched for the answer online many times and always got mixed responses. I have also devised many clever ways to try and test them and even ways to mock $this. However now I’ve got to a point where I’m confident I have a very valid answer to this question and I’m going to try to explain it here… Continue reading

Neat exception classes with traits

So we’re all told that our exception messages should be nice and informative and often sprintf is used to format the exception messages. This is all well and good and is very helpful when an exception gets thrown. However it leads to code that looks like this:

Continue reading