class TestCase

Base class for xUnit-style test cases with setUp/tearDown hooks and data provider support.

Constants

internal ListMethods

internal MethodPattern

Methods

void
run()

Runs all test methods in this test case or a specific test method if provided.

void
runTest(string $method, array|null $args = null)

Runs a single test method, resolving data providers and handling errors.

mixed
getData(string $provider)

No description

void
setUp()

Setup logic to be executed before each test method. Override in subclasses for specific behaviors.

void
tearDown()

Teardown logic to be executed after each test method. Override in subclasses to release resources.

void
skip(string $message = '')

Skips the current test with an optional reason message.

Details

at line 32
void run()

Runs all test methods in this test case or a specific test method if provided.

Return Value

void

at line 77
void runTest(string $method, array|null $args = null)

Runs a single test method, resolving data providers and handling errors.

Parameters

string $method
array|null $args

if provided, bypasses data provider and uses these arguments directly

Return Value

void

at line 157
protected mixed getData(string $provider)

No description

Parameters

string $provider

Return Value

mixed

at line 173
protected void setUp()

Setup logic to be executed before each test method. Override in subclasses for specific behaviors.

Return Value

void

at line 182
protected void tearDown()

Teardown logic to be executed after each test method. Override in subclasses to release resources.

Return Value

void

at line 205
protected void skip(string $message = '')

Skips the current test with an optional reason message.

Parameters

string $message

Return Value

void