定制 alfred-nutile-inc/fixturizer 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

alfred-nutile-inc/fixturizer

最新稳定版本:1.2

Composer 安装命令:

composer require alfred-nutile-inc/fixturizer

包简介

README 文档

README

Build Status

Fixturizer

Quick way to write and read fixture data.

Takes php arrays and quickly puts them on the filesystem as yaml files and vice versa.

See tests folder for Test Examples

Non Laravel Usage

You can see in the tests/FixturizerTest.php file some examples of usage. The main goal being that Writer or Reader allow you to easily pass a filename and path to get or put the file / fixture data in yml format.

If you are using Laravel 5.x

Load up the Provider and Facades

config/app.php load under Providers


    'AlfredNutileInc\Fixturizer\FixturizerServiceProvider'

Load under Facades


    'FixturizerReader' => 'AlfredNutileInc\Fixturizer\FixturizerReader',
    'FixturizerWriter' => 'AlfredNutileInc\Fixturizer\FixturizerWriter',

The default folder is tests/fixtures but you can modify this by running

php artisan vendor:publish --provider="AlfredNutileInc\Fixturizer\FixturizerServiceProvider"

Then you can use it as seen below in a test file


    <?php 
    
    use AlfredNutileInc\Fixturizer\FixturizerReader;
    use AlfredNutileInc\Fixturizer\FixturizerWriter;
    
    class FixtureTest extends \TestCase {

        /**
         * @test
         */
        public function should_write_fixture()
        {
            $fixture = ['foo' => 'bar'];
            FixturizerWriter::createFixture($fixture, 'foo.yml');
            $this->assertFileExists(FixturizerWriter::getDestination() . 'foo.yml');
        }
    
        /**
         * @test
         */
        public function should_read_fixture()
        {
            $name = 'foo.yml';
            $path = base_path() . '/tests/fixtures/';
            $results = FixturizerReader::getFixture($name, $path);
            $this->assertNotNull($results);
        }
    } 

统计信息

  • 总下载量: 6.53k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 12
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2014-11-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固