public static function setUpFunction()

in src/TestUtils/CloudFunctionDeploymentTrait.php [47:69]


    public static function setUpFunction()
    {
        // Make sure projectId is initalized
        if (empty(self::$projectId)) {
            self::checkProjectEnvVars();
        }

        // If $fn is reinitialized, deployment state is reset.
        if (empty(self::$fn)) {
            $props = [
                'projectId' => self::$projectId
            ];
            if (isset(self::$entryPoint)) {
                $props['entryPoint'] = self::$entryPoint;
            }
            if (isset(self::$functionSignatureType)) {
                $props['functionSignatureType'] = self::$functionSignatureType;
            }
            self::$fn = CloudFunction::fromArray(
                self::initFunctionProperties($props)
            );
        }
    }