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

testGetEndpoint() public method

Test for base user and account Api GET endpoints
public testGetEndpoint ( string $path, string $type )
$path string path from api specifications
$type string api specifications type
    public function testGetEndpoint($path, $type)
    {
        if ($type === 'account') {
            $specFile = static::$accountSpec;
            $baseUrl = '/api/' . static::$apiVersion . '/account/';
        } else {
            $specFile = static::$userSpec;
            $baseUrl = '/api/' . static::$apiVersion . '/user/';
        }
        $apiResp = $specFile->getResponse($path, Request::METHOD_GET, 200);
        $entity = $apiResp->getObjectEntity();
        $objectName = $entity->getObjectName();
        $apiUrls = $this->mapPath($path, in_array($objectName, $this->checkScope) ? $type : null);
        if ($apiUrls->valid()) {
            foreach ($apiUrls as $uri) {
                $this->assertFilterableProperties($baseUrl . $uri, $apiResp, $uri);
            }
        } else {
            $this->markTestIncomplete("No data for {$path} endpoint or parent endpoint failed");
        }
    }