class Test (View source)

Test helpers.

Constants

REGEX_DATA_PROVIDER

REGEX_TEST_WITH

REGEX_EXPECTED_EXCEPTION

REGEX_REQUIRES_VERSION

REGEX_REQUIRES_VERSION_CONSTRAINT

REGEX_REQUIRES_OS

REGEX_REQUIRES

UNKNOWN

SMALL

MEDIUM

LARGE

Methods

static mixed
describe(Test $test, bool $asString = true)

No description

static array|bool
getLinesToBeCovered(string $className, string $methodName)

No description

static array
getLinesToBeUsed(string $className, string $methodName)

Returns lines of code specified with the @uses annotation.

static array
getRequirements(string $className, string $methodName)

Returns the requirements for a test.

static string[]
getMissingRequirements(string $className, string $methodName)

Returns the missing requirements for a test.

static array|false
getExpectedException(string $className, string $methodName)

Returns the expected exception for a test.

static array
getProvidedData(string $className, string $methodName)

Returns the provided data for a method.

static array|null
getDataFromTestWithAnnotation(string $docComment)

No description

static array
parseTestMethodAnnotations(string $className, string $methodName = '')

No description

static array
getInlineAnnotations(string $className, string $methodName)

No description

static array
getBackupSettings(string $className, string $methodName)

Returns the backup settings for a test.

static array
getDependencies(string $className, string $methodName)

Returns the dependencies for a test class or method.

static ?bool
getErrorHandlerSettings(string $className, string $methodName)

Returns the error handler settings for a test.

static array
getGroups(string $className, string $methodName = '')

Returns the groups for a test class or method.

static int
getSize(string $className, string $methodName)

Returns the size of the test.

static bool
getProcessIsolationSettings(string $className, string $methodName)

Returns the process isolation settings for a test.

static 
getClassProcessIsolationSettings($className, $methodName)

No description

static ?bool
getPreserveGlobalStateSettings(string $className, string $methodName)

Returns the preserve global state settings for a test.

static array
getHookMethods(string $className)

No description

Details

static mixed describe(Test $test, bool $asString = true)

Parameters

Test $test
bool $asString

Return Value

mixed

static array|bool getLinesToBeCovered(string $className, string $methodName)

Parameters

string $className
string $methodName

Return Value

array|bool

Exceptions

CodeCoverageException

static array getLinesToBeUsed(string $className, string $methodName)

Returns lines of code specified with the @uses annotation.

Parameters

string $className
string $methodName

Return Value

array

static array getRequirements(string $className, string $methodName)

Returns the requirements for a test.

Parameters

string $className
string $methodName

Return Value

array

static string[] getMissingRequirements(string $className, string $methodName)

Returns the missing requirements for a test.

Parameters

string $className
string $methodName

Return Value

string[]

static array|false getExpectedException(string $className, string $methodName)

Returns the expected exception for a test.

Parameters

string $className
string $methodName

Return Value

array|false

static array getProvidedData(string $className, string $methodName)

Returns the provided data for a method.

Parameters

string $className
string $methodName

Return Value

array When a data provider is specified and exists null When no data provider is specified

Exceptions

Exception

static array|null getDataFromTestWithAnnotation(string $docComment)

Parameters

string $docComment full docComment string

Return Value

array|null array when @testWith annotation is defined, null when @testWith annotation is omitted

Exceptions

Exception when @testWith annotation is defined but cannot be parsed

static array parseTestMethodAnnotations(string $className, string $methodName = '')

Parameters

string $className
string $methodName

Return Value

array

Exceptions

ReflectionException

static array getInlineAnnotations(string $className, string $methodName)

Parameters

string $className
string $methodName

Return Value

array

static array getBackupSettings(string $className, string $methodName)

Returns the backup settings for a test.

Parameters

string $className
string $methodName

Return Value

array bool|null>

static array getDependencies(string $className, string $methodName)

Returns the dependencies for a test class or method.

Parameters

string $className
string $methodName

Return Value

array

static ?bool getErrorHandlerSettings(string $className, string $methodName)

Returns the error handler settings for a test.

Parameters

string $className
string $methodName

Return Value

?bool

static array getGroups(string $className, string $methodName = '')

Returns the groups for a test class or method.

Parameters

string $className
string $methodName

Return Value

array

static int getSize(string $className, string $methodName)

Returns the size of the test.

Parameters

string $className
string $methodName

Return Value

int

static bool getProcessIsolationSettings(string $className, string $methodName)

Returns the process isolation settings for a test.

Parameters

string $className
string $methodName

Return Value

bool

static getClassProcessIsolationSettings($className, $methodName)

Parameters

$className
$methodName

static ?bool getPreserveGlobalStateSettings(string $className, string $methodName)

Returns the preserve global state settings for a test.

Parameters

string $className
string $methodName

Return Value

?bool

static array getHookMethods(string $className)

Parameters

string $className

Return Value

array