Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
phpunit_event_sink Class Reference

Event redirection sink. More...

Public Member Functions

 add_event (\core\event\base $event)
 To be called from phpunit_util only!
 
 clear ()
 Removes all previously stored events.
 
 close ()
 Stop event redirection.
 
 count ()
 Return number of events redirected to this sink.
 
 get_events ()
 Returns all redirected events.
 

Protected Attributes

core event base[] $events = array()
 array of events
 

Detailed Description

Event redirection sink.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ add_event()

phpunit_event_sink::add_event ( \core\event\base $event)

To be called from phpunit_util only!

Parameters
core\event\base$eventrecord from event_read table

◆ close()

phpunit_event_sink::close ( )

Stop event redirection.

Use if you do not want event redirected any more.

◆ count()

phpunit_event_sink::count ( )

Return number of events redirected to this sink.

Return values
int

◆ get_events()

phpunit_event_sink::get_events ( )

Returns all redirected events.

The instances are records form the event_read table. The array indexes are numbered from 0 and the order is matching the creation of events.

Return values
core\event\base[]

The documentation for this class was generated from the following file: