title: How do I unit-test inheriting objects?
body: <p>When you use composition, then you can mock the other objects
  from which your class-under-test depends, but when you use
  inheritance, you can't mock the base class. (Or can you?)</p>
  
  <p>I generally try to <a href="https://stackoverflow.com/questions/49002/prefer-composition-over-inheritance">prefer composition over inheritance</a>,
  but sometimes inheritance really seems like the best tool
  for the job - well, at least until it comes to unit-testing.</p>
  
  <p>So, how do you test inheritance? Or do you just trash it as
  untestable and use composition instead?</p>
  
  <p><strong>Note:</strong> I mostly use PHP and PHPUnit, so help on that side
  is most appreciated.  But it would also be interesting to know
  if there are solutions to this problem in other languages.</p>