Expectation for peridot
Installation that uses the composer
Please add the following items to composer.json.
Then please run the composer install.
{
"require-dev": {
"expectation/peridot-expect-plugin": "3.0.0"
}
}
It can be used by simply append the set to peridot.php.
use expect\peridot\ExpectPlugin;
return function(EventEmitterInterface $emitter) {
ExpectPlugin::create()->registerTo($emitter);
};
or
How to configure can be found here.
use expect\peridot\ExpectPlugin;
return function(EventEmitterInterface $emitter) {
ExpectPlugin::createWithConfig('.expect.toml')->registerTo($emitter);
};
You can easily use in the spec file.
describe('Example', function() {
describe('#create', function() {
it('return instance', function() {
expect(Example::create())->toBeAnInstanceOf('Example')
});
});
});