Unit testing PHP classes with private or protected methods and properties can be a real challenge. One solution to the problem is to use a public method that calls the protected method or a getter to access the private property, but that may not be desirable in many instances. more…