PHP unit testing: mock a dependency that doesn't exist yet

Опубликовано: 07 Январь 2025
на канале: Dave Hollingworth
10,348
155

Access the full course ➤ https://davehollingworth.net/phpunity

We use test doubles to isolate the class we're testing, so we can test it without any reliance on external dependencies. Sometimes we want to write and test a class before its dependencies exist. In this video you'll learn how to mock a non-existent class using PHPUnit.