I have a class like this:
class A {
private function testing($x)
{
// do something
$this->privateMethod();
}
private function privateMethod($number) {
// do something
}
}
To invoke testing() I use this:
$reflection = new \ReflectionClass('A');
$method = $reflection->getMethod('testing');
$method->setAccessible(TRUE);
$object = new A();
$parameters = array();
$result = $method->invokeArgs($object, $parameters);
But I don't know how to mock privateMethod(). I want testing only the code in testing() method. I want to point out what I want privateMethod() to return result without actually method to be called.