The practice of replacing an object with a test double that verifies expectations, for instance asserting that a method has been called, is referred to as mocking.
Lets assume we have SomeService to test.
class SomeService
{
private $repository;
public function __construct(Repository $r...