EventTracer
Collects PHPUnit events grouped by their concrete event class.
Description
This tracer MUST store every received event instance under its fully qualified class name so tests MAY later inspect which events were emitted and how many times each event type occurred during execution.
The collected events SHALL remain available in memory for the lifetime of this tracer instance. Consumers SHOULD treat the stored event collection as test-support state and SHOULD NOT rely on it for production behavior.
Returns the number of traced events for the given event class.
public
count(Event>
$eventClass) : int
Description
This method MUST return the exact number of stored events matching the provided fully qualified event class name. When no events were recorded for the given class, the method SHALL return 0.
Parameters
$eventClass
:
Event>
Description
the fully qualified PHPUnit event class name to count
Return values
Description
the number of recorded events for the specified class
Records a PHPUnit event in the internal event registry.
public
trace(Event
$event) : void
Description
This method MUST group the event by its concrete runtime class and SHALL append the received instance to the corresponding event list without discarding previously traced events of the same type.
Parameters
$event
:
Event
Description
the PHPUnit event instance to record