Presented at the ScotlandPHP conference 2017 held in Edinburgh.
Contrary to popular belief, no code is untestable. Sure, writing unit tests for well-crafted code that follows the SOLID principles is easy. But what about legacy code residing in some god class with implicit dependencies and no separation of concerns? We will show you that it is possible to write tests for even the worst code by explaining the why, the what, the how, and the when of software testing while looking at real-world examples.