https://github.com/holyshared/peridot-file-fixture-plugin
File fixture for peridot
https://github.com/holyshared/peridot-file-fixture-plugin
Last synced: about 1 month ago
JSON representation
File fixture for peridot
- Host: GitHub
- URL: https://github.com/holyshared/peridot-file-fixture-plugin
- Owner: holyshared
- License: mit
- Created: 2015-04-16T07:21:09.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-12-04T04:35:02.000Z (over 10 years ago)
- Last Synced: 2025-02-17T13:45:18.802Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
peridot-file-fixture-plugin
====================================
[](https://travis-ci.org/holyshared/peridot-file-fixture-plugin)
[](http://hhvm.h4cc.de/package/holyshared/peridot-file-fixture-plugin)
[](https://coveralls.io/r/holyshared/peridot-file-fixture-plugin)
[](https://scrutinizer-ci.com/g/holyshared/peridot-file-fixture-plugin/?branch=master)
[](https://www.versioneye.com/user/projects/552f70b810e714f9e5000d0c)
[](https://waffle.io/holyshared/peridot-file-fixture-plugin)
Basic usage
------------------------------------
Register the plugin to be able to use in peridot.
Please the configuration file see the [file-fixture](https://github.com/holyshared/file-fixture).
```php
use Evenement\EventEmitterInterface;
use holyshared\peridot\FileFixturePlugin;
return function(EventEmitterInterface $emitter)
{
$plugin = new FileFixturePlugin(__DIR__ . '/fixtures.toml');
$plugin->registerTo($emmiter);
};
```
By calling the **loadFixture** method in spec, you can load the fixture.
```php
describe('Example', function() {
describe('output', function() {
it('return message for user', function() {
$content = $this->loadFixture('text:console', [ 'name' => 'Jhon' ]);
expect('My name is Jhon')->toEqual($content);
});
});
});
```