Notify the right people when tests pass or fail, via the world's simplest messaging service Yo
This is a plugin for PHP's event driven testing framework Peridot
We recommend adding this plugin to your project via composer:
$ composer require --dev peridot-php/peridot-yo-plugin:~1.0
Using the plugin is easy via your peridot.php file:
<?php
use Evenement\EventEmitterInterface;
use Peridot\Plugin\Yo\YoPlugin;
return function (EventEmitterInterface $emitter) {
/**
* Register by passing the peridot event emitter,
* a yo api token obtained from http://dev.justyo.co/,
* an an array of users to be Yo'ed,
* and an optional string or function that returns a link string
*/
$plugin = YoPlugin::register($emitter, "your-yo-token", ['USER1', 'USER2'], 'http://linktobuild.com');
};
This plugin has a few behaviors so you can configure when you want to receive Yo notifications. These all
exist as constants on the YoPlugin
class, and can be passed to the plugin like so:
<?php
use Evenement\EventEmitterInterface;
use Peridot\Plugin\Yo\YoPlugin;
return function (EventEmitterInterface $emitter) {
$plugin = YoPlugin::register($emitter, "your-yo-token", ['USER1', 'USER2'], 'http://linktobuild.com');
$plugin->setBehavior(YoPlugin::BEHAVIOR_ON_PASS);
};
Receive Yo notifications when the test suite passes.
Receive Yo notifications when the test suite fails. This is the default behavior.
Receive Yo notifications when the test suite finishes running.
Tests were written using Peridot. You can run them like so:
$ vendor/bin/peridot specs/
Pull requests, issues, and feedback are of course always welcome.