/** * Calls mock method if its have expectations. Calls parent method otherwise * * @param string $method * @param array $arguments Arguments to pass in method call * * @return mixed See parent implementation */ protected static function callMockOrParent($method, array $arguments) { $classToCall = 'parent'; if (static::$mock && static::$mock->mockery_getExpectationsFor($method)) { $classToCall = static::$mock; } return call_user_func_array(array($classToCall, $method), $arguments); }