class Environment

Testing environment.

Constants

VariableColors

Enable console colors (1 = yes, 0 = no)

VariableRunner

Set when the test is run by Runner

VariableCoverageEngine

Code coverage engine name

VariableCoverage

Path to the code coverage file

VariableThread

Thread number in parallel execution

deprecated COLORS

deprecated RUNNER

deprecated COVERAGE_ENGINE

deprecated COVERAGE

deprecated THREAD

Properties

static $checkAssertions
static $useColors

Methods

static void
setup()

Sets up error handling, colors, code coverage, and assertion tracking for the test process.

static void
setupColors()

Detects whether ANSI colors should be used and wraps output buffer to strip them when not.

static void
setupErrors()

Sets error_reporting, exception handler, and shutdown handler for clean test output.

static void
setupFunctions()

Creates global functions test(), testException(), setUp() and tearDown().

static void
handleException(Throwable $e)

No description

static void
skip(string $message = '')

Skips this test.

static void
lock(string $name = '', string $path = '')

Prevents two parallel tests with the same name from running at the same time.

static array
getTestAnnotations()

Returns annotations from the top-level test file's docblock.

static void
bypassFinals()

Strips the final keyword from PHP source files on load, allowing subclassing of final classes.

static array
loadData()

Returns the current data set passed via @dataProvider annotation or --dataprovider CLI argument.

static void
exit(int $code = 0)

No description

static void
print(string $s)

No description

Details

at line 57
static void setup()

Sets up error handling, colors, code coverage, and assertion tracking for the test process.

Return Value

void

at line 85
static void setupColors()

Detects whether ANSI colors should be used and wraps output buffer to strip them when not.

Return Value

void

at line 108
static void setupErrors()

Sets error_reporting, exception handler, and shutdown handler for clean test output.

Return Value

void

at line 151
static void setupFunctions()

Creates global functions test(), testException(), setUp() and tearDown().

Return Value

void

at line 160
static void handleException(Throwable $e)

internal  
 

No description

Parameters

Throwable $e

Return Value

void

at line 171
static void skip(string $message = '')

Skips this test.

Parameters

string $message

Return Value

void

at line 183
static void lock(string $name = '', string $path = '')

Prevents two parallel tests with the same name from running at the same time.

Parameters

string $name
string $path

directory where the lock file is created

Return Value

void

at line 198
static array getTestAnnotations()

Returns annotations from the top-level test file's docblock.

Return Value

array

at line 210
static void bypassFinals()

Strips the final keyword from PHP source files on load, allowing subclassing of final classes.

Return Value

void

at line 230
static array loadData()

Returns the current data set passed via @dataProvider annotation or --dataprovider CLI argument.

Return Value

array

at line 262
static void exit(int $code = 0)

No description

Parameters

int $code

Return Value

void

at line 270
static void print(string $s)

internal  
 

No description

Parameters

string $s

Return Value

void