PHP Class Scalr\Tests\Functional\Api\V2\TestData\ApiFixture

Since: 5.11 (03.12.2015)
Author: Andrii Penchuk ([email protected])
Show file Open project: scalr/scalr Class Usage Examples

Protected Properties

Property Type Description
$aclTypes array Acl types
$adapterName string Entity adapter name
$apiVersion string API version
$defaultOperation array Default fixtures operation
$env Scalr\Model\Entity\Account\Environment Environment instance
$sets array Data from fixtures
$testEnvId integer Environment identifier
$testUserId integer User identifier
$type string Api endpoint type
$user Scalr\Model\Entity\Account\User Test user
$userTypes array Users types

Public Methods

Method Description
__construct ( array $sets, string $type ) TestDataFixtures constructor.
loadData ( string $fixtures, string $type ) : array Generate data for ApiTest
prepareTestData ( ) Generate test objects for ApiTest

Protected Methods

Method Description
prepareAccountCostCenter ( string $name ) Add CostCenter to account
prepareAccountTeam ( string $name ) Creates and save Account Team entities with data from fixtures
prepareCostCenter ( string $name ) Creates and save CostCenter entity with data from fixtures
prepareData ( string $name ) Check Data if Data has reference another project resolve this data property
prepareFarm ( string $name ) Creates and save Farm entity with data from fixtures
prepareFarmRole ( string $name ) Creates and save farm role entity with data from fixtures
preparePathInfo ( ) : array Prepare options for each patch options
prepareProjects ( string $name ) Add Project entities for test
prepareRole ( string $name ) Create role entity with data from fixtures
prepareRoleCategory ( string $name ) Create role category entity with data from fixtures
prepareRoleImage ( string $name ) Creates and save RoleImage entity with data from fixtures
prepareScript ( string $name ) Creates and save Script entities with data from fixtures
resolveProperty ( $value, $index ) : array If property has reference to the object, will return property or object

Method Details

__construct() public method

TestDataFixtures constructor.
public __construct ( array $sets, string $type )
$sets array data from yaml fixtures
$type string api specifications type

loadData() public static method

Generate data for ApiTest
public static loadData ( string $fixtures, string $type ) : array
$fixtures string patch to fixtures directory
$type string api specifications type
return array

prepareAccountCostCenter() protected method

Add CostCenter to account
protected prepareAccountCostCenter ( string $name )
$name string CostCenter data name

prepareAccountTeam() protected method

Creates and save Account Team entities with data from fixtures
protected prepareAccountTeam ( string $name )
$name string Account Team data name

prepareCostCenter() protected method

Creates and save CostCenter entity with data from fixtures
protected prepareCostCenter ( string $name )
$name string CostCenter data name

prepareData() protected method

Check Data if Data has reference another project resolve this data property
protected prepareData ( string $name )
$name string data name

prepareFarm() protected method

Creates and save Farm entity with data from fixtures
protected prepareFarm ( string $name )
$name string Role category data name

prepareFarmRole() protected method

Creates and save farm role entity with data from fixtures
protected prepareFarmRole ( string $name )
$name string Role category data name

preparePathInfo() protected method

Prepare options for each patch options
protected preparePathInfo ( ) : array
return array

prepareProjects() protected method

Add Project entities for test
protected prepareProjects ( string $name )
$name string Project data name

prepareRole() protected method

Create role entity with data from fixtures
protected prepareRole ( string $name )
$name string Role category data name

prepareRoleCategory() protected method

Create role category entity with data from fixtures
protected prepareRoleCategory ( string $name )
$name string Role category data name

prepareRoleImage() protected method

Creates and save RoleImage entity with data from fixtures
protected prepareRoleImage ( string $name )
$name string Role category data name

prepareScript() protected method

Creates and save Script entities with data from fixtures
protected prepareScript ( string $name )
$name string Script data name

prepareTestData() abstract public method

Generate test objects for ApiTest
abstract public prepareTestData ( )

resolveProperty() protected method

If property has reference to the object, will return property or object
protected resolveProperty ( $value, $index ) : array
$value string property name
$index int property value
return array

Property Details

$aclTypes protected static property

Acl types
protected static array $aclTypes
return array

$adapterName protected property

Entity adapter name
protected string $adapterName
return string

$apiVersion protected static property

API version
protected static string $apiVersion
return string

$defaultOperation protected static property

Default fixtures operation
protected static array $defaultOperation
return array

$env protected static property

Environment instance
protected static Environment,Scalr\Model\Entity\Account $env
return Scalr\Model\Entity\Account\Environment

$sets protected property

Data from fixtures
protected array $sets
return array

$testEnvId protected static property

Environment identifier
protected static int $testEnvId
return integer

$testUserId protected static property

User identifier
protected static int $testUserId
return integer

$type protected property

Api endpoint type
protected string $type
return string

$user protected static property

Test user
protected static User,Scalr\Model\Entity\Account $user
return Scalr\Model\Entity\Account\User

$userTypes protected static property

Users types
protected static array $userTypes
return array