Some time ago I noticed that I no longer use setUp() methods when I write tests. This "just happened", there was no conscious decision behind it. This tweet from Marco Pivetta motivated me to reflect on this change and write down my thoughts in this article.
Matthias Noback - Blog | About software development
Make your PHPUnit data providers even more powerful.... by crell
It sounds simple: test units of code without their real dependencies, use stubs or mocks instead. But if you don't control the replaced dependencies, things can quickly get out of control.
Did you know that a Mock is only one type of a test double? Most of us use the word “mock” to mean any kind of test double, but there’s actually five different types.
<blockquote>When we do not want to use a real dependency in a (unit) test then we can replace it with a test double. PHPUnit as well as third-party libraries such ...</blockquote>