getOriginalFunctionMock(static::getClassNamespace($namespace), $name); } public static function defineFunctionMock($namespace, $name) { static::defineOriginalFunctionMock(static::getClassNamespace($namespace), $name); } private static function getClassNamespace(string $className): string { return (new ReflectionClass($className))->getNamespaceName(); } }