When you need to fix or extend code that is 'far down the rabbit hole', most of the work becomes setting up the complex conditions to push the code to a certain point in the application flow. Instead, open classes up directly using testing harnesses, reflection classes and functional programming. Phpunit will be used to demonstrate code coverage before and after.