PHPackages                             dakatsuka/blueprint-bundle - 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. dakatsuka/blueprint-bundle

ActiveSymfony-bundle[Testing &amp; Quality](/categories/testing)

dakatsuka/blueprint-bundle
==========================

The bundle provides a way to manage test data for the Doctrine ORM

1.1.0(12y ago)47.7kMITPHPPHP &gt;=5.3.2

Since Jun 5Pushed 12y ago1 watchersCompare

[ Source](https://github.com/dakatsuka/BlueprintBundle)[ Packagist](https://packagist.org/packages/dakatsuka/blueprint-bundle)[ RSS](/packages/dakatsuka-blueprint-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

Blueprint Bundle [![Build Status](https://camo.githubusercontent.com/22f9d8b89c192261e0b8f0d1c7a1c66d773db490eeb48b295c2548d5304e1be9/68747470733a2f2f7472617669732d63692e6f72672f64616b617473756b612f426c75657072696e7442756e646c652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/dakatsuka/BlueprintBundle)
===========================================================================================================================================================================================================================================================================================================================

[](#blueprint-bundle-)

The bundle provides a way to manage test data for the Doctrine ORM.

Installation
------------

[](#installation)

Add this lines to your composer.json:

```
{
    "require": {
        "dakatsuka/blueprint-bundle": "1.1.0"
    },
}
```

And then execute:

```
$ php composer.phar install
```

And import a BlueprintBundle to AppKernel.php:

```
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
    $bundles[] = new Dakatsuka\BlueprintBundle\DakatsukaBlueprintBundle();
}
```

Usage
-----

[](#usage)

src/Acme/BlogBundle/Tests/Blueprints/post.php:

```
namespace Acme\BlogBundle\Tests\Blueprints;

use Dakatsuka\BlueprintBundle\Blueprint;

Blueprint::register('post', 'Acme\BlogBundle\Entity\Post', function($post, $blueprint) {
    $post->setTitle('Title'.$blueprint->sequence());
    $post->setBody('BodyBodyBody');
});
```

src/Acme/BlogBundle/Tests/Blueprints/comment.php:

```
namespace Acme\BlogBundle\Tests\Blueprints;

use Dakatsuka\BlueprintBundle\Blueprint;

Blueprint::register('comment', 'Acme\BlogBundle\Entity\Comment', function($comment, $blueprint) {
    $comment->setPost($blueprint->create('post'));
    $comment->setBody('CommentCommentComment');
});
```

How to use:

```
static::$kernel = static::createKernel();
static::$kernel->boot();
static::$container = static::$kernel->getContainer();

$blueprint = static::$container->get('dakatsuka.blueprint');
$blueprint->loadFromDirectory(static::$kernel->getRootDir() . '/../src/Acme/BlogBundle/Tests/Blueprints');

$post = $blueprint->create('post');
$this->assertEquals('Title1', $post->getTitle());
$this->assertEquals('BodyBodyBody', $post->getBody());

$comment = $blueprint->create('comment');
$this->assertEquals('CommentCommentComment', $comment->getBody());
$this->assertEquals('Title2', $comment->getPost()->getTitle());

// optional
$comment2 = $blueprint->create('comment', array('post' => $post));
$this->assertSame($post, $comment2->getPost());
```

Tips
----

[](#tips)

Nested blueprint (required cascade={"persist"} option):

```
Blueprint::register('post', 'Acme\BlogBundle\Entity\Post', function($post, $blueprint) {
    $post->setTitle('Title'.$blueprint->sequence());
    $post->setBody('BodyBodyBody');
    $post->getComments()->add($blueprint->build('comment', array('post' => $post));
    $post->getComments()->add($blueprint->build('comment', array('post' => $post));
    $post->getComments()->add($blueprint->build('comment', array('post' => $post));
});
```

Contributing
------------

[](#contributing)

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

### Test

[](#test)

```
$ make phpunit
$ make test
```

Copyright
---------

[](#copyright)

Copyright (C) 2013 Dai Akatsuka, released under the MIT License.

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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 ~46 days

Total

5

Last Release

4536d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c14404a98a46334c9131aa4f6f071bd6b4b279670eb0e74d27d39104e12c1a3b?d=identicon)[dakatsuka](/maintainers/dakatsuka)

---

Top Contributors

[![dakatsuka](https://avatars.githubusercontent.com/u/59034?v=4)](https://github.com/dakatsuka "dakatsuka (20 commits)")

---

Tags

testSymfony2blueprint

### Embed Badge

![Health badge](/badges/dakatsuka-blueprint-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/dakatsuka-blueprint-bundle/health.svg)](https://phpackages.com/packages/dakatsuka-blueprint-bundle)
```

###  Alternatives

[mockery/mockery

Mockery is a simple yet flexible PHP mock object framework

10.7k497.0M23.5k](/packages/mockery-mockery)[hamcrest/hamcrest-php

This is the PHP port of Hamcrest Matchers

7.1k484.1M109](/packages/hamcrest-hamcrest-php)[nelmio/alice

Expressive fixtures generator

2.5k43.4M133](/packages/nelmio-alice)[behat/mink-browserkit-driver

Symfony2 BrowserKit driver for Mink framework

54462.0M316](/packages/behat-mink-browserkit-driver)[zenstruck/foundry

A model factory library for creating expressive, auto-completable, on-demand dev/test fixtures with Symfony and Doctrine.

78311.9M97](/packages/zenstruck-foundry)[brain/monkey

Mocking utility for PHP functions and WordPress plugin API

33412.5M346](/packages/brain-monkey)

PHPackages © 2026

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