Свойство | Type | Description | |
---|---|---|---|
$accountSpec | Object generated of Account Api specifications | ||
$adapters | List of adapters using in test | ||
$checkScope | array | Object where should check scope | |
$data | array | Test data container for testGetEndpoint() | |
$dbObjectMapping | array | Mapping api object name and specific which gives an entity this object Key is object name Value is functions name | |
$defaultAcl | Default test Acl | ||
$filterPropertyMap | array | Map filterable properties key based on object name in Api definitions | |
$fullAccessAcl | Scalr\Tests\Fixtures\Api\V2\Acl\ApiTestAcl | ||
$ignoreCheckRules | array | List of objects where should ignore check filterable properties | |
$maxResults | false | integer | Max response results | |
$noAccessAcl | PHPUnit_Framework_MockObject_MockObject | ||
$paramMap | array | Mapping params in path definitions and response objects | |
$pathMap | array | Map save structure if object need other data structure key based on object name in Api definitions | |
$propertyAssertMap | array | Mapping specifics assert for properties Key is property name Value is functions name | |
$readOnlyAccessAcl | Scalr\Tests\Fixtures\Api\V2\Acl\ApiTestAcl | ||
$simpleFilterRules | |||
$testData | array | Ids of data generated during the test Destructor clean up data by these ids | |
$testUserType | string | Default user type | |
$userSpec | Object generated of User Api specifications |
Méthode | Description | |
---|---|---|
__construct ( $name = null, $data = [], $dataName = null ) | ||
assertBuiltinAutomation ( array $filterValue, array $property, string $message ) | Custom assert BuiltinAutomation property | |
assertFilterableProperties ( string $url, |
Assert and check unique filterable properties from requested url | |
assertGetEndpoint ( string $uri, |
Return list of Objects available in this account or environment | |
assertTeams ( object $team, object[] $teams, string $message ) | Reports an error if specified team is not present in the list of teams of the Farm obtained by filtration | |
checkAdapterRules ( |
Check adapter rules | |
dataApiProvider ( ) : array | Data provider for testApi() | |
dataGetEndpointProvider ( ) : array[] | Data provider for testGetEndpoint() | |
getAdapter ( string $class, |
Gets API entity adapter | |
getEnvironmentEntity ( integer $envId ) : |
Gets Environment entity | |
getFilter ( string $class = null, string $property = null, array $values = [] ) : |
Makes the filtering rule for the specified properties of an object | |
getFixturesDirectory ( ) | ||
getGlobalVariable ( string $criteria, array $params ) : array | Get GV | |
setUpBeforeClass ( ) | Add test environment, test Acl, setups test user, environment and API key | |
tearDownAfterClass ( ) | Removes API key generated for test | |
testApi ( string $path, string | Exceptio\Exception $type, string $adapter, string $aclType, string $userType, string $method, integer $responseCode, array $params, array $filterable, array $body ) | Test for Api endpoints Data provider prepares data for Api request SpecFile get responses definition from api specifications for each endpoint ResponseBodyConstraint compares Api definition with request | |
testGetEndpoint ( string $path, string $type ) | Test for base user and account Api GET endpoints |
Méthode | Description | |
---|---|---|
getDbObject ( string $objectName, string $criteria, string $entityClass, array $params ) : mixed | Get db object | |
getEnvironmentTeam ( string $criteria, array $params ) : |
Gets TeamEnvs entity | |
getFarmRoleScalingMetrics ( string $criteria, array $params = [] ) : |
Get FarmRoleScalingMetric entity | |
getScalingMetric ( string $criteria ) : |
Get ScalingMetric entity | |
getScriptVersion ( string $criteria, array $params ) : Scalr\Model\Entity\ScriptVersion | Gets ScriptVersion entity | |
mapApiResponsePk ( string $path, string $objectName ) : string | On the based api endpoint and name api object return primary key If pk don't exist in paramMath throw fail | |
mapPath ( string $path, string $type ) : Generator | Generate url with api endpoint and saved data | |
matchApiUrl ( string $path, array $params = [] ) : string | Match API url params | |
saveUrlData ( string $url, stdClass $object, string $nameEntity ) | Save data for x-usedIn endpoints | |
setTestAcl ( string $acl ) | Set mock acl for test | |
setUp ( ) | ||
setUserType ( string $type ) | Set user types for test Some endpoints need extra credentials | |
tearDown ( ) |
public assertFilterableProperties ( string $url, |
||
$url | string | Request uri |
$apiResp | Schema current object generated of api specification | |
$saveDataPath | string | Save url for child endpoints |
public assertGetEndpoint ( string $uri, |
||
$uri | string | Request uri |
$apiResp | schema current object generated of api specification | |
$filters | array | optional Filterable properties |
$collect | boolean | optional Collect response data |
$maxResults | null | integer | optional max list results |
Résultat | array |
public assertTeams ( object $team, object[] $teams, string $message ) | ||
$team | object | Filter value |
$teams | object[] | Filtering property of the object obtained by filtration |
$message | string | optional Message in case of error |
public checkAdapterRules ( |
||
$objectEntity | api object entity generated form specs | |
$rules | array | list of rules |
public dataApiProvider ( ) : array | ||
Résultat | array |
public dataGetEndpointProvider ( ) : array[] | ||
Résultat | array[] |
public getAdapter ( string $class, |
||
$class | string | Adapter class |
$controller | optional API Controller | |
Résultat |
public getEnvironmentEntity ( integer $envId ) : |
||
$envId | integer | environment identifier |
Résultat |
protected getEnvironmentTeam ( string $criteria, array $params ) : |
||
$criteria | string | search criteria |
$params | array | query params |
Résultat |
protected getFarmRoleScalingMetrics ( string $criteria, array $params = [] ) : |
||
$criteria | string | search criteria |
$params | array | optional query params |
Résultat |
protected getScalingMetric ( string $criteria ) : |
||
$criteria | string | search criteria |
Résultat |
protected getScriptVersion ( string $criteria, array $params ) : Scalr\Model\Entity\ScriptVersion | ||
$criteria | string | search criteria |
$params | array | query params |
Résultat | Scalr\Model\Entity\ScriptVersion |
protected saveUrlData ( string $url, stdClass $object, string $nameEntity ) | ||
$url | string | api url |
$object | stdClass | api object |
$nameEntity | string | name api entity |
protected setTestAcl ( string $acl ) | ||
$acl | string | Acl type for tests |
public static setUpBeforeClass ( ) |
protected setUserType ( string $type ) | ||
$type | string | User type |
public static tearDownAfterClass ( ) |
public testApi ( string $path, string | Exceptio\Exception $type, string $adapter, string $aclType, string $userType, string $method, integer $responseCode, array $params, array $filterable, array $body ) | ||
$path | string | Api endpoint |
$type | string | Exceptio\Exception | Api specifications type |
$adapter | string | Adapter name |
$aclType | string | Acl type for test |
$userType | string | UserType for test |
$method | string | HTTP method |
$responseCode | integer | HTTP code |
$params | array | Array of path parameters |
$filterable | array | Array of GET parameters |
$body | array | Array of POST parameters |
public testGetEndpoint ( string $path, string $type ) | ||
$path | string | path from api specifications |
$type | string | api specifications type |
protected static SpecManager,Scalr\Tests\Functional\Api\V2\SpecSchema $accountSpec | ||
Résultat |
protected static ApiEntityAdapter[],Scalr\Api\DataType $adapters | ||
Résultat |
protected array $checkScope | ||
Résultat | array |
protected static array $data | ||
Résultat | array |
protected array $dbObjectMapping | ||
Résultat | array |
protected static Acl,Scalr\Acl $defaultAcl | ||
Résultat |
protected array $filterPropertyMap | ||
Résultat | array |
protected static ApiTestAcl,Scalr\Tests\Fixtures\Api\V2\Acl $fullAccessAcl | ||
Résultat | Scalr\Tests\Fixtures\Api\V2\Acl\ApiTestAcl |
protected array $ignoreCheckRules | ||
Résultat | array |
protected static false|int $maxResults | ||
Résultat | false | integer |
protected static PHPUnit_Framework_MockObject_MockObject $noAccessAcl | ||
Résultat | PHPUnit_Framework_MockObject_MockObject |
protected array $paramMap | ||
Résultat | array |
protected array $pathMap | ||
Résultat | array |
protected array $propertyAssertMap | ||
Résultat | array |
protected static ApiTestAcl,Scalr\Tests\Fixtures\Api\V2\Acl $readOnlyAccessAcl | ||
Résultat | Scalr\Tests\Fixtures\Api\V2\Acl\ApiTestAcl |
protected static array $testData | ||
Résultat | array |
protected static string $testUserType | ||
Résultat | string |