peridot-php/peridot-yo-plugin
Composer 安装命令:
composer require --dev peridot-php/peridot-yo-plugin
包简介
"YO! The right people when a test run finishes"
关键字:
README 文档
README
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
Usage
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'); };
Behaviors
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); };
BEHAVIOR_ON_PASS
Receive Yo notifications when the test suite passes.
BEHAVIOR_ON_FAIL
Receive Yo notifications when the test suite fails. This is the default behavior.
BEHAVIOR_ALWAYS
Receive Yo notifications when the test suite finishes running.
Running tests
Tests were written using Peridot. You can run them like so:
$ vendor/bin/peridot specs/
Contributing
Pull requests, issues, and feedback are of course always welcome.
统计信息
- 总下载量: 15
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-10-21