ytest is a PHPUnit extension, based on the PHP extension "runkit", that allows you to replace static, private, and global functions with fakes, stubs, or mocks. This eases the automated testing of PHP applications that weren't written in a TDD fashion (i.e. test-first). It can also be helpful on projects where many methods are kept private, or projects that don't use OOP so much. ytest has already been used to "test after" (as opposed to "test first") some real-life commercial projects, and has proven useful. It needs PHP >= 5.2.