PHP Class Scalr\Tests\TestCase

Since: 03.12.2012
Author: Vitaliy Demidov ([email protected])
Inheritance: extends PHPUnit_Framework_TestCase
Mostra file Open project: scalr/scalr Class Usage Examples

Public Properties

Property Type Description
$dbLog

Public Methods

Method Description
assertArrayHas ( mixed $value, string $key, array | ArrayAccess $arr, string $message = '' ) Constraints that array has key and value
assertSubClassOf ( string $className, object $object, string $message = '' ) Constraints that object is sub-class of the specified class
camelize ( string $input ) : string Camelizes string
disableDbLog ( ) Disables mysql log
enableDbLog ( ) Enables mysql log
getAccessibleMethod ( object $object, string $method ) : ReflectionMethod Gets reflection method for the specified object
getAccessibleProperty ( object $object, string $property ) : ReflectionProperty Gets reflection property for the specified object
getDbLog ( ) : array Gets mysql database log
getFixturesDirectory ( ) : string Returns fixtures directory
getTestName ( string $suffix = '' ) : string Gets test name
isSkippedFunctionalTest ( string $type = null ) : boolean Returns true if functional tests should be skipped.

Protected Methods

Method Description
getInstallationId ( ) : string Retrieves ID of the Scalr installation.
getSessionId ( ) : string Retrieves unique session id.
runTest ( )
setUp ( )
tearDown ( )

Method Details

assertArrayHas() public static method

Constraints that array has key and value
public static assertArrayHas ( mixed $value, string $key, array | ArrayAccess $arr, string $message = '' )
$value mixed Expected array value
$key string Expected array key
$arr array | ArrayAccess An array which needs to be evaluated
$message string Message

assertSubClassOf() public static method

Constraints that object is sub-class of the specified class
public static assertSubClassOf ( string $className, object $object, string $message = '' )
$className string The name of the class
$object object The object to check
$message string optional The message

camelize() public method

Camelizes string
public camelize ( string $input ) : string
$input string
return string Returns camelized string

disableDbLog() public static method

Disables mysql log
public static disableDbLog ( )

enableDbLog() public static method

Enables mysql log
public static enableDbLog ( )

getAccessibleMethod() public static method

Gets reflection method for the specified object
public static getAccessibleMethod ( object $object, string $method ) : ReflectionMethod
$object object Object
$method string Private or Protected Method name
return ReflectionMethod Returns reflection method for provided object with setAccessible property

getAccessibleProperty() public static method

Gets reflection property for the specified object
public static getAccessibleProperty ( object $object, string $property ) : ReflectionProperty
$object object Object
$property string Private or protected property name
return ReflectionProperty Returns reflection property for provided object with setAccessible property

getDbLog() public static method

Gets mysql database log
public static getDbLog ( ) : array
return array Returns logged sql queries

getFixturesDirectory() public method

Returns fixtures directory
public getFixturesDirectory ( ) : string
return string Returns fixtures directory without trailing slash

getInstallationId() protected static method

It is used for isolation the functional tests of third party services like AWS, OpenStack ... etc
protected static getInstallationId ( ) : string
return string Returns ID of the Scalr installation

getSessionId() protected static method

This number is unique per each test execution.
protected static getSessionId ( ) : string
return string Returns unique session id.

getTestName() public static method

Gets test name
public static getTestName ( string $suffix = '' ) : string
$suffix string optional Name suffix
return string Returns test name

isSkippedFunctionalTest() public static method

Returns true if functional tests should be skipped.
public static isSkippedFunctionalTest ( string $type = null ) : boolean
$type string optional The type of the test ui, api, cloud-dependent. If option is not provided it will try to resolve static::TEST_TYPE constant
return boolean Returns true if functional tests should be skipped.

runTest() protected method

See also: PHPUnit_Framework_TestCase::runTest()
protected runTest ( )

setUp() protected method

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

tearDown() protected method

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

Property Details

$dbLog public_oe static_oe property

public static $dbLog