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(12y ago)32.1k4[2 issues](https://github.com/camspiers/silverstripe-fixturegenerator/issues)MITPHP

Since Apr 3Pushed 12y 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 6d 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 46% 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

4384d 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

[phpro/grumphp

A composer plugin that enables source code quality checks.

4.3k17.0M1.1k](/packages/phpro-grumphp)[behat/behat

Scenario-oriented BDD framework for PHP

4.0k103.4M2.3k](/packages/behat-behat)[craftcms/cms

Craft CMS

3.6k3.7M3.4k](/packages/craftcms-cms)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k20](/packages/tempest-framework)[mglaman/phpstan-drupal

Drupal extension and rules for PHPStan

20832.2M213](/packages/mglaman-phpstan-drupal)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

12017.1k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

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