highly extensible, highly enjoyable, BDD testing framework for PHP.

Plugins

Peridot exposes a handful of events that can be hooked into via a configuration file. This mechanism is the easiest, and preferred way by which Peridot is extended. A core design goal of Peridot is to keep the core framework as lean as possible - while opening up a ton of possibilities via events, scopes, and dsls.

Peridot will look for a file called peridot.php in the current working directory, or one can be specified using the --configuration option via the console. The configuration file will be included once, and it should return a function that accepts a single EventEmitter containing ->on() and ->emit() methods.

<?php //peridot.php
return function(EventEmitterInterface $emitter) {
    $emitter->on('test.failed', function($test) {
        //do something with the failed test
    });
}

The Peridot team has leveraged this mechanism already to create some really cool plugins:

Reporters

Peridot ships with a spec reporter for printing test results in a hierarchal manner. However, you can easily create your own reporters.

Reporters can be registered via the configuration file like any other plugin through the peridot.reporters event. Plugin authors can create reporters to support their added functionality, or reporters can be created as standalone plugins themselves. Check out some of the additional reporters created by the Peridot team:

Check out Peridot's own peridot.php file for an example of creating a custom reporter.