PHP Класс Scalr\Tests\WebTestCase

С версии: 21.02.2013
Автор: Vitaliy Demidov ([email protected])
Наследование: extends TestCase
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_testEnvId integer ID of the user's environment
$_testUserId integer ID of the user which is used in the functional test

Защищенные методы

Метод Описание
assertResponseDataHasKeys ( array $keys, array $responseData, boolean $checkAll = false, string $dataColumnName = 'data' ) Asserts that response data array has necessary data keys.
getEnvironment ( ) : Scalr_Environment Gets a test environment instance
getRequest ( $requestType = Scalr_UI_Request::REQUEST_TYPE_UI, $requestClass = null, striing $uri, array $parameters = [], string $method = 'GET', array $server = [], array $files = [] ) : Scalr_UI_Request Prepares request
getUser ( ) : Scalr_Account_user Gets an test User instance
internalRequest ( string $uri, array $parameters = [] ) : mixed Get internal request to the controller's action ignoring checking aliases
isAdminUserTestClass ( ) : boolean Returns true if current test is for Scalr Admin privilege
markTestSkippedIfFunctionalTestsDisabled ( ) Marks test skipped if functional tests are disabled
markTestSkippedIfPlatformDisabled ( string $platform ) Skip test if platform does not enabled
request ( string $uri, array $parameters = [], string $method = 'GET', array $server = [], array $files = [] ) : array | string Makes a request to site
setUp ( )
tearDown ( )

Описание методов

assertResponseDataHasKeys() защищенный Метод

Asserts that response data array has necessary data keys.
protected assertResponseDataHasKeys ( array $keys, array $responseData, boolean $checkAll = false, string $dataColumnName = 'data' )
$keys array Array of the keys or Index array that looks like array($key => $constraint)
$responseData array Response array
$checkAll boolean optional Whether it should check all data array or only the first.
$dataColumnName string optional The name of the data column

getEnvironment() защищенный Метод

Gets a test environment instance
protected getEnvironment ( ) : Scalr_Environment
Результат Scalr_Environment Returns environment instance

getRequest() защищенный Метод

Prepares request
protected getRequest ( $requestType = Scalr_UI_Request::REQUEST_TYPE_UI, $requestClass = null, striing $uri, array $parameters = [], string $method = 'GET', array $server = [], array $files = [] ) : Scalr_UI_Request
$uri striing A request uri
$parameters array optional Request parameters
$method string optional HTTP Request method
$server array optional Additional server options
$files array optional Uploaded files array
Результат Scalr_UI_Request Returns array which represents returned json object or raw body content in the case if the response is not a json.

getUser() защищенный Метод

Gets an test User instance
protected getUser ( ) : Scalr_Account_user
Результат Scalr_Account_user Returns user instance

internalRequest() защищенный Метод

Get internal request to the controller's action ignoring checking aliases
protected internalRequest ( string $uri, array $parameters = [] ) : mixed
$uri string
$parameters array
Результат mixed Returns raw response as it is returned by action

isAdminUserTestClass() защищенный Метод

Returns true if current test is for Scalr Admin privilege
protected isAdminUserTestClass ( ) : boolean
Результат boolean

markTestSkippedIfFunctionalTestsDisabled() защищенный Метод

Marks test skipped if functional tests are disabled

markTestSkippedIfPlatformDisabled() защищенный Метод

Skip test if platform does not enabled
protected markTestSkippedIfPlatformDisabled ( string $platform )
$platform string

request() защищенный Метод

Makes a request to site
protected request ( string $uri, array $parameters = [], string $method = 'GET', array $server = [], array $files = [] ) : array | string
$uri string A request uri
$parameters array optional Request parameters
$method string optional HTTP Request method
$server array optional Additional server options
$files array optional Uploaded files array
Результат array | string Returns array which represents returned json object or raw body content in the case if the responce is not a json.

setUp() защищенный Метод

См. также: PHPUnit_Framework_TestCase::setUp()
protected setUp ( )

tearDown() защищенный Метод

См. также: PHPUnit_Framework_TestCase::tearDown()
protected tearDown ( )

Описание свойств

$_testEnvId защищенное свойство

ID of the user's environment
protected int $_testEnvId
Результат integer

$_testUserId защищенное свойство

ID of the user which is used in the functional test
protected int $_testUserId
Результат integer