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

Flush Data state.

void
flushFortifyState()

Flush Fortify state.

void
flushHorizonState()

Flush Horizon state.

void
flushImageState()

Flush Image state.

void
flushInertiaState()

Flush Inertia state.

void
flushJwtState()

Flush JWT state.

void
flushNestedSetState()

Flush Nested Set state.

void
flushPasskeysState()

Flush Passkeys 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 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 343
protected void flushDataState()

Flush Data state.

Return Value

void

at line 354
protected void flushFortifyState()

Flush Fortify state.

Return Value

void

at line 362
protected void flushHorizonState()

Flush Horizon state.

Return Value

void

at line 374
protected void flushImageState()

Flush Image state.

Return Value

void

at line 382
protected void flushInertiaState()

Flush Inertia state.

Return Value

void

at line 394
protected void flushJwtState()

Flush JWT state.

Return Value

void

at line 403
protected void flushNestedSetState()

Flush Nested Set state.

Return Value

void

at line 411
protected void flushPasskeysState()

Flush Passkeys state.

Return Value

void

at line 421
protected void flushPermissionState()

Flush Permission state.

Return Value

void

at line 431
protected void flushReverbState()

Flush Reverb state.

Return Value

void

at line 440
protected void flushSaloonState()

Flush Saloon state.

Return Value

void

at line 451
protected void flushSanctumState()

Flush Sanctum state.

Return Value

void

at line 461
protected void flushScoutState()

Flush Scout state.

Return Value

void

at line 470
protected void flushSentryState()

Flush Sentry state.

Return Value

void

at line 481
protected void flushTelescopeState()

Flush Telescope state.

Return Value

void

at line 492
protected void flushTestbenchState()

Flush Testbench state.

Return Value

void

at line 504
protected void flushWayfinderState()

Flush Wayfinder state.

Return Value

void

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