Fake It 'til You Make It: A Practical Guide to Fakes and TDD in PHP

Опубликовано: 15 Май 2026
на канале: The Engineering Coach
257
4

This is the final episode in our series on Test Doubles! I'm your Coding Coach, and in this video, we'll look at Fakes, a powerful type of test double that helps you write fast, reliable tests. We'll implement one from scratch using PHPUnit to show you how they work and when to use them.

Unlike Stubs or Spies, which are often used for a specific test, a Fake is a working implementation of a dependency that uses shortcuts to make it suitable for testing. It's a key tool for isolating your code and improving test performance, especially for dependencies like databases or APIs.

The code for this episode can be found on GitHub: https://github.com/the-engineering-co...

Watch the Full Series:
For a complete understanding of test doubles, be sure to watch the full series from the beginning:
👉 Watch the full Test Doubles playlist here:    • Test Doubles Explained: A Complete PHP Gui...  

Let's Connect
For more software engineering tutorials and coaching, subscribe to The Engineering Coach on YouTube. You can also connect with me on Bluesky or Mastodon.

Mastodon: https://mastodon.social/@braddle
Bluesky: https://bsky.app/profile/braddle1.bsk...
LinkedIn:   / mark-bradley-engineering-coach  

#TDD #PHP #Fake #TestDoubles #TestDrivenDevelopment #TheEngineeringCoach #CodingCoach