highly extensible, highly enjoyable, BDD testing framework for PHP.
Peridot Events
Peridot features an event driven architecture. This has not only greatly simplified Peridot's own source code, it also allows testers to easily customize Peridot via plugins and reporters. The Peridot event emitter can be accessed via the peridot.php file:
The following events are available for your testing pleasure:
-
peridot.start
Fires when the Peridot application is constructed. Useful for defining additional CLI arguments and options.
Arguments:
Environment$environment
Application$application
-
peridot.configure
Fires when the Peridot application is configured. Useful for overriding configuration values and configuring the Peridot test runner.
Arguments:
Configuration$configuration
Application$application
-
peridot.execute
Fires right before Peridot starts execution. Happens after CLI options are parsed and before specs are loaded.
Arguments:
InputInterface$input
OutputInterface$output
-
peridot.reporters
Fires when Peridot reporters are registered. Useful for registering additional reporters.
Arguments:
InputInterface$input
ReporterFactory$reporters
-
peridot.load
Fires right before Peridot starts loading tests. Useful for changing loading behavior.
Arguments:
Command$command
Configuration$configuration
-
peridot.end
Fires when the Peridot application exits.
Arguments:
integer$exitCode
InputInterface$input
OutputInterface$output
-
runner.start
Fires right before the suite runner starts.
Arguments: No arguments
-
runner.end
Fires right after the suite runner ends.
Arguments:
float$runTime
-
suite.define
Fires right before a suite definition is executed. Ideal for passing arguments to the definition function.
Arguments:
Suite$suite
-
suite.start
Fires right before a suite runs.
Arguments:
Suite$suite
-
suite.end
Fires right after a suite runs.
Arguments:
Suite$suite
-
suite.halt
When fired, this event signals a suite to stop running.
Arguments: No arguments
-
test.passed
Fires when a test passes.
Arguments:
Test$test
-
test.pending
Fires when a test pends.
Arguments:
Test$test
-
test.failed
Fires when a test fails.
-
test.start
Fires right before a test runs.
Arguments:
Test$test
-
test.end
Fires right after a test runs.
Arguments:
Test$test
-
error
Fires when a PHP error occurs. The standard error arguments passed to a function registered via PHP's native
set_error_handler
will be passed to this event.Arguments:
integer$errno
string$errstr
string$errfile
string$errline