Environment
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
Sets up error handling, colors, code coverage, and assertion tracking for the test process.
Detects whether ANSI colors should be used and wraps output buffer to strip them when not.
Sets error_reporting, exception handler, and shutdown handler for clean test output.
Creates global functions test(), testException(), setUp() and tearDown().
Skips this test.
Prevents two parallel tests with the same name from running at the same time.
Returns annotations from the top-level test file's docblock.
Strips the final keyword from PHP source files on load, allowing subclassing of final classes.
Returns the current data set passed via @dataProvider annotation or --dataprovider CLI argument.
No description
No description
Details
at line 57
static void
setup()
Sets up error handling, colors, code coverage, and assertion tracking for the test process.
at line 85
static void
setupColors()
Detects whether ANSI colors should be used and wraps output buffer to strip them when not.
at line 108
static void
setupErrors()
Sets error_reporting, exception handler, and shutdown handler for clean test output.
at line 151
static void
setupFunctions()
Creates global functions test(), testException(), setUp() and tearDown().
at line 160
static void
handleException(Throwable $e)
| internal |
No description
at line 171
static void
skip(string $message = '')
Skips this test.
at line 183
static void
lock(string $name = '', string $path = '')
Prevents two parallel tests with the same name from running at the same time.
at line 198
static array
getTestAnnotations()
Returns annotations from the top-level test file's docblock.
at line 210
static void
bypassFinals()
Strips the final keyword from PHP source files on load, allowing subclassing of final classes.
at line 230
static array
loadData()
Returns the current data set passed via @dataProvider annotation or --dataprovider CLI argument.
at line 262
static void
exit(int $code = 0)
No description
at line 270
static void
print(string $s)
| internal |
No description