Skip to content

holyshared/peridot-file-fixture-plugin

Repository files navigation

peridot-file-fixture-plugin

Build Status HHVM Status Coverage Status Scrutinizer Code Quality Dependency Status Stories in Ready

Basic usage

Register the plugin to be able to use in peridot.
Please the configuration file see the file-fixture.

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.

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);
        });
    });
});

About

File fixture for peridot

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages