Scalr\Tests\Functional\Api\V2\ApiTest::dataGetEndpointProvider PHP Method

dataGetEndpointProvider() public method

Data provider for testGetEndpoint()
public dataGetEndpointProvider ( ) : array[]
return array[]
    public function dataGetEndpointProvider()
    {
        $basePaths = static::$userSpec->getPathTemplates(Request::METHOD_GET);
        $farmRoles = array_filter($basePaths, function ($v) {
            return preg_match('#^/{envId}/farm-roles#', $v);
        });
        foreach ($farmRoles as $i => $farmRole) {
            unset($basePaths[$i]);
        }
        array_push($basePaths, ...$farmRoles);
        $data = [];
        foreach ($basePaths as $basePath) {
            $data[$basePath] = [$basePath, 'user'];
        }
        $basePaths = static::$accountSpec->getPathTemplates(Request::METHOD_GET);
        foreach ($basePaths as $basePath) {
            $data[$basePath] = [$basePath, 'account'];
        }
        if (file_exists($ignoreFile = $this->getFixturesDirectory() . '/ignorePath.yaml')) {
            $ignorePaths = yaml_parse_file($ignoreFile);
            if (!empty($ignorePaths = $ignorePaths['paths'])) {
                $data = array_filter($data, function ($k) use($ignorePaths) {
                    foreach ($ignorePaths as $path) {
                        if (preg_match("#{$path}#", $k)) {
                            return false;
                        }
                    }
                    return true;
                }, ARRAY_FILTER_USE_KEY);
            }
        }
        return $data;
    }