This repository contains all the code for The Engineering Coach YouTube video, "Unit Test Isolation: How to Master External Dependencies (PHP)".
In this video, we dive into the crucial practice of unit test isolation. This project demonstrates why it's so important to isolate your tests from external dependencies, such as databases, APIs, or even "real-world" concerns like the current time.
- Why test isolation is a fundamental skill for writing robust unit tests.
- How to replace external dependencies with Test Doubles.
- Practical techniques for handling time-dependent code.
- The key to writing fast, reliable, and predictable tests.
This video is an excellent resource for anyone who wants to improve the quality and reliability of their test suite.
👉 Click here to watch the full tutorial!
To run the code and follow along with the video, you'll need PHP and Composer.
- Clone the repository:
git clone https://github.com/testingallthethings/019-unittest-isolation-php
cd 019-unittest-isolation-php
- Install the dependencies:
composer install
- Run the tests:
./vendor/bin/phpunit
The Engineering Coach is a YouTube channel dedicated to helping software engineers and engineering managers improve their skills and craft. We provide practical advice and tutorials on topics that matter in the real world of software development.
For more software engineering tutorials and coaching, subscribe to The Engineering Coach on YouTube. You can also connect with me on Bluesky or Mastodon.