I have a class structure like this:
class A {
public someFunction() {
$objectB = new B();
$result = $objectB->getResult();
return $result;
}
}
I am writing the unit test for someFunction() that belongs to class A. However, it depends on class B. I can mock someFunction() but how can I resolve the dependency on class B? I want to mock class B automatically.