2017 © Pedro Peláez
 

library silverstripe-fixturegenerator

Allows the generation of SilverStripe unit test fixtures from existing DataObjects either programatically created or from the database

image

camspiers/silverstripe-fixturegenerator

Allows the generation of SilverStripe unit test fixtures from existing DataObjects either programatically created or from the database

  • Thursday, August 14, 2014
  • by camspiers
  • Repository
  • 1 Watchers
  • 3 Stars
  • 1,575 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 9 Versions
  • 1 % Grown

The README.md

SilverStripe Fixture Generator

Build Status against 2.2 and 3.0, (*1)

Allows the generation of SilverStripe unit test fixtures from existing DataObjects either programatically created or from the database., (*2)

Creating fixtures files for unit tests is tedious at best, and this library's goal is to alleviate some of the pain., (*3)

Installation (with composer)

$ composer require camspiers/silverstripe-fixturegenerator:~0.1

Usage

Example with all relations allowed

use Camspiers\SilverStripe\FixtureGenerator;

$records = //some DataObjectSet

(new FixtureGenerator\Generator(
    new FixtureGenerator\Dumpers\Yaml(
        __DIR__ . '/tests/MyFixture.yml'
    )
))->process($records);

Example with certain relations allowed

use Camspiers\SilverStripe\FixtureGenerator;

$records = //some DataObjectSet

(new FixtureGenerator\Generator(
    new FixtureGenerator\Dumpers\Yaml(
        __DIR__ . '/tests/MyFixture.yml'
    ),
    array(
        'MyDataObject.SomeHasOneRelation',
        'MyDataObject.SomeHasManyRelation'
    )
))->process($records);

Example with certain relations excluded

use Camspiers\SilverStripe\FixtureGenerator;

$records = //some DataObjectSet

(new FixtureGenerator\Generator(
    new FixtureGenerator\Dumpers\Yaml(
        __DIR__ . '/tests/MyFixture.yml'
    ),
    array(
        'MyDataObject.SomeHasOneRelation',
        'MyDataObject.SomeHasManyRelation'
    ),
    FixtureGenerator\Generator::RELATION_MODE_EXCLUDE
))->process($records);

Unit testing

$ composer install --dev
$ phpunit

The Versions

14/08 2014

dev-master

9999999-dev

Allows the generation of SilverStripe unit test fixtures from existing DataObjects either programatically created or from the database

  Sources   Download

MIT

The Requires

 

The Development Requires

14/08 2014

0.1.7

0.1.7.0

Allows the generation of SilverStripe unit test fixtures from existing DataObjects either programatically created or from the database

  Sources   Download

MIT

The Requires

 

The Development Requires

17/04 2013

0.1.6

0.1.6.0

Allows the generation of SilverStripe unit test fixtures from existing DataObjects either programatically created or from the database

  Sources   Download

MIT

The Requires

 

The Development Requires

05/04 2013

0.1.5

0.1.5.0

Allows the generation of SilverStripe unit test fixtures from existing DataObjects either programatically created or from the database

  Sources   Download

MIT

The Requires

 

The Development Requires

05/04 2013

0.1.4

0.1.4.0

Allows the generation of SilverStripe unit test fixtures from existing DataObjects either programatically created or from the database

  Sources   Download

MIT

The Requires

 

The Development Requires

04/04 2013

0.1.3

0.1.3.0

Allows the generation of SilverStripe unit test fixtures from existing DataObjects either programatically created or from the database

  Sources   Download

MIT

The Requires

 

The Development Requires

04/04 2013

0.1.2

0.1.2.0

Allows the generation of SilverStripe unit test fixtures from existing DataObjects either programatically created or from the database

  Sources   Download

MIT

The Requires

 

The Development Requires

03/04 2013

0.1.1

0.1.1.0

Allows the generation of SilverStripe unit test fixtures from existing DataObjects either programatically created or from the database

  Sources   Download

MIT

The Requires

 

The Development Requires

03/04 2013

0.1.0

0.1.0.0

Allows the generation of SilverStripe unit test fixtures from existing DataObjects either programatically created or from the database

  Sources   Download

MIT

The Requires

 

The Development Requires