PHPackages                             camspiers/silverstripe-fixturegenerator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. camspiers/silverstripe-fixturegenerator

ActiveLibrary[Testing &amp; Quality](/categories/testing)

camspiers/silverstripe-fixturegenerator
=======================================

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

0.1.7(11y ago)32.1k4[2 issues](https://github.com/camspiers/silverstripe-fixturegenerator/issues)MITPHP

Since Apr 3Pushed 11y ago1 watchersCompare

[ Source](https://github.com/camspiers/silverstripe-fixturegenerator)[ Packagist](https://packagist.org/packages/camspiers/silverstripe-fixturegenerator)[ RSS](/packages/camspiers-silverstripe-fixturegenerator/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (3)Versions (9)Used By (0)

SilverStripe Fixture Generator
==============================

[](#silverstripe-fixture-generator)

[![Build Status](https://camo.githubusercontent.com/975c04cb4b3d8638246f4b86c3e3f1ed929f36d43cd151b7e53a311f01296f28/68747470733a2f2f7472617669732d63692e6f72672f63616d7370696572732f73696c7665727374726970652d6669787475726567656e657261746f722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/camspiers/silverstripe-fixturegenerator) against 2.2 and 3.0

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

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

Installation (with composer)
----------------------------

[](#installation-with-composer)

```
$ composer require camspiers/silverstripe-fixturegenerator:~0.1
```

Usage
-----

[](#usage)

### Example with all relations allowed

[](#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

[](#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

[](#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
------------

[](#unit-testing)

```
$ composer install --dev
$ phpunit
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~71 days

Recently: every ~124 days

Total

8

Last Release

4339d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/51294?v=4)[Cam Spiers](/maintainers/camspiers)[@camspiers](https://github.com/camspiers)

---

Top Contributors

[![camspiers](https://avatars.githubusercontent.com/u/51294?v=4)](https://github.com/camspiers "camspiers (25 commits)")

### Embed Badge

![Health badge](/badges/camspiers-silverstripe-fixturegenerator/health.svg)

```
[![Health](https://phpackages.com/badges/camspiers-silverstripe-fixturegenerator/health.svg)](https://phpackages.com/packages/camspiers-silverstripe-fixturegenerator)
```

###  Alternatives

[behat/behat

Scenario-oriented BDD framework for PHP

4.0k100.2M2.2k](/packages/behat-behat)[phpro/grumphp

A composer plugin that enables source code quality checks.

4.3k16.3M983](/packages/phpro-grumphp)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k42.5M39.3k](/packages/orchestra-testbench)[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[mglaman/phpstan-drupal

Drupal extension and rules for PHPStan

20731.4M169](/packages/mglaman-phpstan-drupal)[spatie/phpunit-snapshot-assertions

Snapshot testing with PHPUnit

69619.8M615](/packages/spatie-phpunit-snapshot-assertions)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
