PHP Class Scalr\Tests\Service\CloudStack\CloudStackTestCase

Since: 4.5.2
Author: Vlad Dobrovolskiy ([email protected])
Inheritance: extends Scalr\Tests\TestCase
Show file Open project: scalr/scalr Class Usage Examples

Protected Properties

Property Type Description
$cloudstack Scalr\Service\CloudStack\CloudStack CloudStack instance

Public Methods

Method Description
getCloudStackClassName ( string $classSuffix ) : string Gets full class name by its suffix after CloudStack\\
getCloudStackFixtureClassName ( string $classSuffix ) : string Gets full FIXTURE class name by its suffix after CloudStack\\
getCloudStackMock ( string $serviceName = null, Closure | callback | string $callback = null ) : CloudStack Gets an CloudStack mock
getContainer ( ) : Container Gets DI Container
getEnvironment ( ) : Environment Gets Scalr Environment
getFixtureFileContent ( string $filename ) : string Gets fixture file content
getFixtureFilePath ( string $filename ) : string Returns fixtures file path
getFixturesDirectory ( )
getQueryClientResponseMock ( string $body, $command, integer $responseCode = null ) : QueryClientResponse Gets QueryClientResponse Mock.
getServiceInterfaceMock ( string $serviceName, CloudStack $csStub ) : ServiceInterface Gets an service interface mock object

Protected Methods

Method Description
setUp ( )
tearDown ( )

Method Details

getCloudStackClassName() public method

Gets full class name by its suffix after CloudStack\\
public getCloudStackClassName ( string $classSuffix ) : string
$classSuffix string
return string

getCloudStackFixtureClassName() public method

Gets full FIXTURE class name by its suffix after CloudStack\\
public getCloudStackFixtureClassName ( string $classSuffix ) : string
$classSuffix string
return string

getCloudStackMock() public method

Gets an CloudStack mock
public getCloudStackMock ( string $serviceName = null, Closure | callback | string $callback = null ) : CloudStack
$serviceName string Service name (Network, Volume etc..)
$callback Closure | callback | string optional callback for QueryClientResponse mock
return Scalr\Service\CloudStack\CloudStack Returns CloudStack Mock stub

getContainer() public method

Gets DI Container
public getContainer ( ) : Container
return Scalr\DependencyInjection\Container

getEnvironment() public method

Gets Scalr Environment
public getEnvironment ( ) : Environment
return Environment

getFixtureFileContent() public method

Gets fixture file content
public getFixtureFileContent ( string $filename ) : string
$filename string A fixture file name
return string Returns fixture file content

getFixtureFilePath() public method

Returns fixtures file path
public getFixtureFilePath ( string $filename ) : string
$filename string A fixture file name
return string Returns fixtures file path

getFixturesDirectory() public method

getQueryClientResponseMock() public method

Gets QueryClientResponse Mock.
public getQueryClientResponseMock ( string $body, $command, integer $responseCode = null ) : QueryClientResponse
$body string
$responseCode integer optional The code of the http response
return QueryClientResponse Returns response mock object

getServiceInterfaceMock() public method

Gets an service interface mock object
public getServiceInterfaceMock ( string $serviceName, CloudStack $csStub ) : ServiceInterface
$serviceName string Service name (Network, Volume etc..)
$csStub Scalr\Service\CloudStack\CloudStack CloudStack Mock stub
return ServiceInterface Returns service interface mock

setUp() protected method

See also: PHPUnit_Framework_TestCase::setUp()
protected setUp ( )

tearDown() protected method

See also: PHPUnit_Framework_TestCase::tearDown()
protected tearDown ( )

Property Details

$cloudstack protected property

CloudStack instance
protected CloudStack,Scalr\Service\CloudStack $cloudstack
return Scalr\Service\CloudStack\CloudStack