Unit testing static methods in PHP

Опубликовано: 14 Ноябрь 2024
на канале: Dave Hollingworth
3,654
41

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

You'll probably come across some articles and opinions that say static methods can't be tested, and that using static methods should be avoided. While there are problems with static methods, as far as testing goes, this isn't true - you can test static methods. The problem with static methods comes when trying to mock them. In this video we'll look at an example of how to test a static method.