title: Best practices to test protected methods with PHPUnit
body: <p>I found the discussion on <a href="https://stackoverflow.com/questions/105007/do-you-test-private-method">Do you test private method</a> informative.</p>
  
  <p>I have decided, that in some classes, I want to have protected methods, but test them.
  Some of these methods are static and short. Because most of the public methods make use of them, I will probably be able to safely remove the tests later. But for starting with a TDD approach and avoid debugging, I really want to test them.</p>
  
  <p>I thought of the following:</p>
  
  <ul>
  <li><a href="http://www.refactoring.com/catalog/replaceMethodWithMethodObject.html" rel="noreferrer">Method Object</a> as adviced in <a href="https://stackoverflow.com/questions/105007/do-you-test-private-method#105021">an answer</a> seems to be overkill for this.</li>
  <li>Start with public methods and when code coverage is given by higher level tests, turn them protected and remove the tests.</li>
  <li>Inherit a class with a testable interface making protected methods public</li>
  </ul>
  
  <p>Which is best practice? Is there anything else?</p>
  
  <p>It seems, that JUnit automatically changes protected methods to be public, but I did not have a deeper look at it. PHP does not allow this via <a href="http://php.net/language.oop5.reflection" rel="noreferrer">reflection</a>.</p>