expect / peridot-expect-plugin
对 peridot 的期望
4.0.0
2016-08-10 03:31 UTC
Requires
- php: >=5.6.0
- expect/expect: ~2.0
- peridot-php/peridot: ~1.18
Requires (Dev)
- beberlei/assert: ~2.6
- cloak/peridot-cloak-plugin: ~2.0
- cloak/robo-coveralls-kit: ~2.1
- codegyre/robo: ~0.7
- holyshared/robo-peridot: ~2.0
- phpspec/prophecy: ~1.6
README
对 peridot 的期望
安装
使用 composer 的安装
请在 composer.json 中添加以下项。
然后请运行 composer install。
{ "require-dev": { "expectation/peridot-expect-plugin": "3.0.0" } }
基本用法
只需将设置附加到 peridot.php 即可使用。
use expect\peridot\ExpectPlugin; return function(EventEmitterInterface $emitter) { ExpectPlugin::create()->registerTo($emitter); };
或者
配置方法请参考 此处。
use expect\peridot\ExpectPlugin; return function(EventEmitterInterface $emitter) { ExpectPlugin::createWithConfig('.expect.toml')->registerTo($emitter); };
spec 示例
您可以在 spec 文件中轻松使用。
describe('Example', function() { describe('#create', function() { it('return instance', function() { expect(Example::create())->toBeAnInstanceOf('Example') }); }); });