class AfterEachTestSubscriber implements FinishedSubscriber

Coordinates exactly one global cleanup after every test method.

Prepared tests clean after PHPUnit finishes them. Tests that never become prepared clean before the next test captures global state, or when the test runner finishes if there is no next test.

Properties

protected bool $cleanupPending

Whether the current or most recent test still needs global cleanup.

Methods

void
notify(Finished $event)

Clean up static state after a test finishes.

void
handlePreparationStarted()

Handle internal preparation-started coordination for the PHPUnit extension.

void
handleExecutionFinished()

Handle internal execution-finished coordination for the PHPUnit extension.

void
flushPendingCleanup()

Flush pending cleanup at most once.

void
flushStateAfterTest()

Flush all test state after a test finishes.

void
flushFrameworkState()

Flush framework-owned static state.

void
flushFortifyState()

Flush Fortify state.

void
flushHorizonState()

Flush Horizon state.

void
flushInertiaState()

Flush Inertia state.

void
flushNestedSetState()

Flush Nested Set state.

void
flushPasskeysState()

Flush Passkeys state.

void
flushPermissionState()

Flush Permission state.

void
flushReverbState()

Flush Reverb state.

void
flushSanctumState()

Flush Sanctum state.

void
flushScoutState()

Flush Scout state.

void
flushSentryState()

Flush Sentry state.

void
flushTelescopeState()

Flush Telescope state.

void
flushTestbenchState()

Flush Testbench state.

void
flushWayfinderState()

Flush Wayfinder state.

void
callIfExists(string $class, string $method, mixed ...$arguments)

Call a static cleanup method when the class is installed.

Details

at line 30
void notify(Finished $event)

Clean up static state after a test finishes.

Parameters

Finished $event

Return Value

void

at line 38
void handlePreparationStarted()

Handle internal preparation-started coordination for the PHPUnit extension.

Return Value

void

at line 50
void handleExecutionFinished()

Handle internal execution-finished coordination for the PHPUnit extension.

Return Value

void

at line 58
protected void flushPendingCleanup()

Flush pending cleanup at most once.

Return Value

void

at line 71
void flushStateAfterTest()

Flush all test state after a test finishes.

Return Value

void

at line 107
protected void flushFrameworkState()

Flush framework-owned static state.

Return Value

void

at line 342
protected void flushFortifyState()

Flush Fortify state.

Return Value

void

at line 350
protected void flushHorizonState()

Flush Horizon state.

Return Value

void

at line 362
protected void flushInertiaState()

Flush Inertia state.

Return Value

void

at line 374
protected void flushNestedSetState()

Flush Nested Set state.

Return Value

void

at line 382
protected void flushPasskeysState()

Flush Passkeys state.

Return Value

void

at line 392
protected void flushPermissionState()

Flush Permission state.

Return Value

void

at line 402
protected void flushReverbState()

Flush Reverb state.

Return Value

void

at line 411
protected void flushSanctumState()

Flush Sanctum state.

Return Value

void

at line 420
protected void flushScoutState()

Flush Scout state.

Return Value

void

at line 429
protected void flushSentryState()

Flush Sentry state.

Return Value

void

at line 438
protected void flushTelescopeState()

Flush Telescope state.

Return Value

void

at line 448
protected void flushTestbenchState()

Flush Testbench state.

Return Value

void

at line 460
protected void flushWayfinderState()

Flush Wayfinder state.

Return Value

void

at line 468
protected void callIfExists(string $class, string $method, mixed ...$arguments)

Call a static cleanup method when the class is installed.

Parameters

string $class
string $method
mixed ...$arguments

Return Value

void