-
-
Notifications
You must be signed in to change notification settings - Fork 0
JoliNotifExecutionFinishedSubscriber
Sends a desktop notification when the PHPUnit execution finishes.
This subscriber MUST summarize the current PHPUnit run using the counters collected by the shared event tracer and SHALL dispatch a concise desktop notification through the configured notifier implementation.
The generated notification MUST preserve the effective behavior currently expected by the application:
- successful runs SHALL report only the total number of executed tests, followed by expanded telemetry details;
- unsuccessful runs SHALL report the number of passed tests together with the relevant failure and error counters, followed by expanded telemetry details.
When process forking support is available, notification delivery SHOULD be delegated to a child process so the main PHPUnit process MAY continue shutting down without waiting for the desktop notification transport to complete.
- Full name:
\FastForward\DevTools\PhpUnit\Event\TestSuite\JoliNotifExecutionFinishedSubscriber - This class is marked as final and can't be subclassed
- This class implements:
ExecutionFinishedSubscriber - This class is a Final class
Creates a new execution-finished subscriber instance.
public __construct(\FastForward\DevTools\PhpUnit\Event\EventTracer $tracer, \Joli\JoliNotif\NotifierInterface $notifier = new \Joli\JoliNotif\DefaultNotifier()): mixedThe provided tracer MUST contain the event history collected during the current PHPUnit run so this subscriber can derive an accurate summary. When no notifier is explicitly provided, the default JoliNotif notifier SHALL be used.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$tracer |
\FastForward\DevTools\PhpUnit\Event\EventTracer | the event tracer used to inspect recorded |
| PHPUnit events and derive notification data | ||
$notifier |
\Joli\JoliNotif\NotifierInterface | the notifier responsible for |
| dispatching the desktop notification |
Handles the PHPUnit execution finished event.
public notify(\PHPUnit\Event\TestRunner\ExecutionFinished $event): voidThis method MUST build the final notification payload using the computed title, execution summary, and telemetry details. When process forking is available, the parent process SHALL return immediately after a successful fork, and the child process SHALL send the notification and terminate explicitly. When forking support is not available, or the fork attempt fails, the notification MUST still be delivered synchronously so functional behavior remains unchanged.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$event |
\PHPUnit\Event\TestRunner\ExecutionFinished | the emitted PHPUnit execution finished |
| event |