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
flushAiState()

Flush AI state.

void
flushDataState()

Flush Data state.

void
flushDoctorState()

Flush Doctor state.

void
flushFortifyState()

Flush Fortify state.

void
flushHeadState()

Flush Head state.

void
flushHorizonState()

Flush Horizon state.

void
flushImageState()

Flush Image state.

void
flushInertiaState()

Flush Inertia state.

void
flushJwtState()

Flush JWT state.

void
flushMcpState()

Flush MCP state.

void
flushNestedSetState()

Flush Nested Set state.

void
flushPasskeysState()

Flush Passkeys state.

void
flushPassportState()

Flush Passport state.

void
flushPennantState()

Flush Pennant state.

void
flushPermissionState()

Flush Permission state.

void
flushReverbState()

Flush Reverb state.

void
flushSaloonState()

Flush Saloon 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 31
void notify(Finished $event)

Clean up static state after a test finishes.

Parameters

Finished $event

Return Value

void

at line 39
void handlePreparationStarted()

Handle internal preparation-started coordination for the PHPUnit extension.

Return Value

void

at line 51
void handleExecutionFinished()

Handle internal execution-finished coordination for the PHPUnit extension.

Return Value

void

at line 59
protected void flushPendingCleanup()

Flush pending cleanup at most once.

Return Value

void

at line 72
void flushStateAfterTest()

Flush all test state after a test finishes.

Return Value

void

at line 108
protected void flushFrameworkState()

Flush framework-owned static state.

Return Value

void

at line 362
protected void flushAiState()

Flush AI state.

Return Value

void

at line 372
protected void flushDataState()

Flush Data state.

Return Value

void

at line 383
protected void flushDoctorState()

Flush Doctor state.

Return Value

void

at line 391
protected void flushFortifyState()

Flush Fortify state.

Return Value

void

at line 399
protected void flushHeadState()

Flush Head state.

Return Value

void

at line 409
protected void flushHorizonState()

Flush Horizon state.

Return Value

void

at line 421
protected void flushImageState()

Flush Image state.

Return Value

void

at line 429
protected void flushInertiaState()

Flush Inertia state.

Return Value

void

at line 442
protected void flushJwtState()

Flush JWT state.

Return Value

void

at line 451
protected void flushMcpState()

Flush MCP state.

Return Value

void

at line 468
protected void flushNestedSetState()

Flush Nested Set state.

Return Value

void

at line 476
protected void flushPasskeysState()

Flush Passkeys state.

Return Value

void

at line 486
protected void flushPassportState()

Flush Passport state.

Return Value

void

at line 495
protected void flushPennantState()

Flush Pennant state.

Return Value

void

at line 504
protected void flushPermissionState()

Flush Permission state.

Return Value

void

at line 513
protected void flushReverbState()

Flush Reverb state.

Return Value

void

at line 522
protected void flushSaloonState()

Flush Saloon state.

Return Value

void

at line 534
protected void flushSanctumState()

Flush Sanctum state.

Return Value

void

at line 544
protected void flushScoutState()

Flush Scout state.

Return Value

void

at line 553
protected void flushSentryState()

Flush Sentry state.

Return Value

void

at line 563
protected void flushTelescopeState()

Flush Telescope state.

Return Value

void

at line 574
protected void flushTestbenchState()

Flush Testbench state.

Return Value

void

at line 586
protected void flushWayfinderState()

Flush Wayfinder state.

Return Value

void

at line 594
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