Repository navigation
Events
At the heart of Peridot is an event system powered by Événement. We chose Événement for it's simplicity, and it is a key player in the simplicity of Peridot plugin development.
You can leverage all of Peridot's events via a peridot.php file placed in the current working directory from where you run your tests, or by specifying a path to one using the -c or --configuration switches from the command line.
//peridot.php
use Evenement\EventEmitterInterface;
//if peridot.php returns a function, that function will be executed.
return function(EventEmitterInterface $emitter) {
$emitter->on('test.failed', function($test) {
//do something with $test
});
};##Event Reference
The following is a list of all the events that Peridot uses, and the arguments that are included with them.
###peridot.start
Fires when the Peridot application is first constructed. This event is useful for defining additional
CLI arguments and options. This is how the watcher plugin adds the --watch option to Peridot.
Event Arguments:
- Environment $environment
- Application $application
###peridot.configure Fires after the Peridot application is configured.
Event Arguments:
- Configuration $configuration
###peridot.execute Fires right before Peridot starts execution. Happens after CLI options are parsed and before specs are loaded.
Event Arguments:
- InputInterface $input
- OutputInterface $output
###peridot.reporters Fires when Peridot reporters are registered. Useful for registering additional reporters.
Event Arguments:
- InputInterface $input
- ReporterFactory $reporters
###peridot.load Fires right before Peridot starts loading tests. Useful for changing loading behavior.
Event Arguments:
- Command $command
- Configuration $configuration