This document discusses testing untestable code in PHP. It begins by defining untestable code as code with global variables, static methods, tight coupling, or dependencies that cannot be controlled. It then provides examples of how to test such code by manipulating autoloading, namespaces, filesystem mocking with vfsStream, and overwriting internal functions with runkit. Finally, it discusses generating testable code through generative programming that extracts, customizes, and recombines code parts to make it testable. The overall message is that with flexibility, one can work around PHP limitations and change their mindset to write testable code through practices like dependency injection.