PHPackages                             richcongress/fixture-test - 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. richcongress/fixture-test

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

richcongress/fixture-test
=========================

Generate random and meaningful data for objects

v0.2.0(1y ago)039.2k↓43.3%12MITPHPPHP ^8.1

Since Jan 29Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/rich-id/fixture-test)[ Packagist](https://packagist.org/packages/richcongress/fixture-test)[ RSS](/packages/richcongress-fixture-test/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (6)Versions (8)Used By (2)

 [![](./.github/logo.svg)](./.github/logo.svg)

[![fixture test](https://camo.githubusercontent.com/e8e437207969d4c4f4e9dce2fcd4b8778e03f98d9404ab5839dc68e620528dfe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72696368636f6e67726573732f666978747572652d74657374)](https://packagist.org/packages/richcongress/fixture-test)[![badge](https://github.com/richcongress/fixture-test/workflows/Tests/badge.svg)](https://github.com/richcongress/fixture-test/actions)[![badge](https://camo.githubusercontent.com/091af849c31f34d7ddb99b0b8ec79ce14cd44797d9d6d33c4411413a47360045/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f72696368636f6e67726573732f666978747572652d746573742f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/richcongress/fixture-test?branch=master)[![maintainability](https://camo.githubusercontent.com/59a94dd568d570992675dcc277f86f782563a9dc013e83fe2ad476879f2a6f9b/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f63313964383237346634366435376661663763342f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/richcongress/fixture-test/maintainability)[![contributions welcome brightgreen](https://camo.githubusercontent.com/9e93e892d0685e1bf7a1d0bd7c8410d6ecf2086a0a7b48dd58a6b96fa556ea2a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6e747269627574696f6e732d77656c636f6d652d627269676874677265656e2e7376673f7374796c653d666c6174)](https://github.com/richcongress/test-suite/issues)[![license MIT blue](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![PHP 7](https://camo.githubusercontent.com/f13cc5baf57b8e115f484fde3c7ade83b2a814edc6940da54ec35bac43eb3faf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e332532422d79656c6c6f77)](https://camo.githubusercontent.com/f13cc5baf57b8e115f484fde3c7ade83b2a814edc6940da54ec35bac43eb3faf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e332532422d79656c6c6f77)[![Symfony 4%2B black](https://camo.githubusercontent.com/c7f909c07c2aaac81c18968088fe3f5c9fc6348987b7f330e177fdcd24a1ea9e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d342532422d626c61636b)](https://camo.githubusercontent.com/c7f909c07c2aaac81c18968088fe3f5c9fc6348987b7f330e177fdcd24a1ea9e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d342532422d626c61636b)[![Symfony 5%2B black](https://camo.githubusercontent.com/0b1128137c1357779f86a0d8f2734fbb557fd154175959c66c0174bbf9e855e5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d352532422d626c61636b)](https://camo.githubusercontent.com/0b1128137c1357779f86a0d8f2734fbb557fd154175959c66c0174bbf9e855e5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d352532422d626c61636b)

This library provides tools to generate quickly an object with its properties filled with random but meaningful values.

Table of content
----------------

[](#table-of-content)

- [1. Quick showcase](#quick-showcase)
- [2. Installation](#installation)
    - [2.1. Symfony](#symfony)
- [3. Documentation](#documentation)
    - [3.1. Configuration](#configuration)
- [4. Versioning](#versioning)
- [5. Contributing](#contributing)
- [6. License](#license)
- [7. Hacking](#hacking)

1. Quick showcase
-----------------

[](#1-quick-showcase)

```
final class User
{
    /** @var int */
    private $id;

    /** @var string */
    private $username;

    /** @var string */
    private $password;

    /** @var \DateTime */
    private $dateAdd;

    /** @var \DateTime */
    private $dateUpdate;

    /** @var string */
    private $biography;
}
```

The `FixtureGenerator` can create an instance of this class:

```
$fixtureGenerator = new \RichCongress\FixtureTestBundle\Generator\FixtureGenerator();
$user = $fixtureGenerator->generate(User::class, [
    'biography' => 'This was generated by the library',
]);
```

If we serialize the class in Json, it will give something like this:

```
{
    // This is always null, we don't want the library to mess up with Doctrine
    "id": null,

    // This is a random username
    "username": "john_doe",

    // This is a random password
    "password": "k&|X+a45*2[",

    // This is a random date between -200 days and today
    "dateAdd": "2019-12-03 11:07:02",

    // Notice the dateUpdate is always after the dateAdd
    "dateUpdate": "2020-03-04 18:57:41",

    // This is a hard value given during the generation, so any property can be quickly overriden
    "biography": "This was generated by the library"
}
```

2. Installation
---------------

[](#2-installation)

This version of the bundle requires Symfony 6.0+ and PHP 8.1+.

```
composer require richcongress/fixture-test
```

### 2.1. Symfony

[](#21-symfony)

If you plan to use it with Symfony, please install the `richcongress/bundle-toolbox` before, and makes sure that the `RichCongressFixtureTestBundle` is in the `bundles.php`.

3. Documentation
----------------

[](#3-documentation)

### 3.1. [Configuration](docs/Configuration.adoc)

[](#31-configuration)

4. Versioning
-------------

[](#4-versioning)

fixture-test follows [semantic versioning](https://semver.org/). In short the scheme is MAJOR.MINOR.PATCH where 1. MAJOR is bumped when there is a breaking change, 2. MINOR is bumped when a new feature is added in a backward-compatible way, 3. PATCH is bumped when a bug is fixed in a backward-compatible way.

Versions bellow 1.0.0 are considered experimental and breaking changes may occur at any time.

5. Contributing
---------------

[](#5-contributing)

Contributions are welcomed! There are many ways to contribute, and we appreciate all of them. Here are some of the major ones:

- [Bug Reports](https://github.com/richcongress/fixture-test/issues): While we strive for quality software, bugs can happen, and we can’t fix issues we’re not aware of. So please report even if you’re not sure about it or just want to ask a question. If anything the issue might indicate that the documentation can still be improved!
- [Feature Request](https://github.com/richcongress/fixture-test/issues): You have a use case not covered by the current api? Want to suggest a change or add something? We’d be glad to read about it and start a discussion to try to find the best possible solution.
- [Pull Request](https://github.com/richcongress/fixture-test/pulls): Want to contribute code or documentation? We’d love that! If you need help to get started, GitHub as [documentation](https://help.github.com/articles/about-pull-requests/) on pull requests. We use the ["fork and pull model"](https://help.github.com/articles/about-collaborative-development-models/) were contributors push changes to their personal fork and then create pull requests to the main repository. Please make your pull requests against the `master` branch.

As a reminder, all contributors are expected to follow our [Code of Conduct](./CODE_OF_CONDUCT.md).

6. License
----------

[](#6-license)

cookies-regulation-bundle is distributed under the terms of the MIT license.

See [LICENSE](./LICENSE) for details.

7. Hacking
----------

[](#7-hacking)

You might use Docker and `docker-compose` to hack the project. Check out the following commands.

```
# Start the project
docker-compose up -d

# Install dependencies
docker-compose exec application composer install

# Run tests
docker-compose exec application bin/phpunit

# Run a bash within the container
docker-compose exec application bash
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance54

Moderate activity, may be stable

Popularity28

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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 ~244 days

Recently: every ~303 days

Total

6

Last Release

714d ago

PHP version history (2 changes)v0.1.0PHP &gt;=7.3

v0.2.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/6bfb5e4a3dde826e4cd3f92d24fdfbdce1415c77f3edd38fc3420b4988977e13?d=identicon)[HugoDumazeau](/maintainers/HugoDumazeau)

![](https://www.gravatar.com/avatar/8084ee0162a85df3b3f49230b8c0dde81108195caa541bb00642cbd050e88b25?d=identicon)[hudumazeau](/maintainers/hudumazeau)

---

Top Contributors

[![NicolasGuilloux](https://avatars.githubusercontent.com/u/4090627?v=4)](https://github.com/NicolasGuilloux "NicolasGuilloux (10 commits)")[![mdevlamynck](https://avatars.githubusercontent.com/u/4378377?v=4)](https://github.com/mdevlamynck "mdevlamynck (2 commits)")

---

Tags

fixturesphp-librarytest

### Embed Badge

![Health badge](/badges/richcongress-fixture-test/health.svg)

```
[![Health](https://phpackages.com/badges/richcongress-fixture-test/health.svg)](https://phpackages.com/packages/richcongress-fixture-test)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[instaclick/php-webdriver

PHP WebDriver for Selenium 2

43661.8M22](/packages/instaclick-php-webdriver)[spatie/phpunit-snapshot-assertions

Snapshot testing with PHPUnit

69617.9M510](/packages/spatie-phpunit-snapshot-assertions)[lchrusciel/api-test-case

Perfect PHPUnit TestCase for JSON/XML API TDD with Symfony.

4115.5M63](/packages/lchrusciel-api-test-case)

PHPackages © 2026

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