Take for example I have a class SampleService
like following, now how can I write unit test with PHPUnit for the getName()
method? more specifically how can i mock self::_getName();
with Mockery? If that is not possible, what are the best approach/way to write unit test for this kinds of scenarios? Thanks.
class SampleService implements Service
{
public function getName(){
$name = self::_getName();
return 'Mr. '.$name;
}
private static function _getName(){
return 'Some Name';
}
}