holyshared/peridot-file-fixture-plugin

1.0.3 2015-12-04 04:32 UTC

This package is auto-updated.

Last update: 2024-09-15 16:02:22 UTC


README

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

基本用法

注册插件以便在 peridot 中使用。
有关配置文件的详细信息,请参阅 file-fixture

use Evenement\EventEmitterInterface;
use holyshared\peridot\FileFixturePlugin;

return function(EventEmitterInterface $emitter)
{
    $plugin = new FileFixturePlugin(__DIR__ . '/fixtures.toml');
    $plugin->registerTo($emmiter);
};

在 spec 中调用 loadFixture 方法可以加载测试用例。

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