mirror of
https://github.com/symfony/recipes.git
synced 2026-09-19 11:06:33 +03:00
[zenstruc/foundry] Add 2.6 config & one story as fixture (#1415)
This commit is contained in:
@@ -2,7 +2,7 @@ when@dev: &dev
|
|||||||
# See full configuration: https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#full-default-bundle-configuration
|
# See full configuration: https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#full-default-bundle-configuration
|
||||||
zenstruck_foundry:
|
zenstruck_foundry:
|
||||||
persistence:
|
persistence:
|
||||||
# Flush only once per call of `PersistentObjectFactory::create()` in userland
|
# Flush only once per call of `PersistentObjectFactory::create()`
|
||||||
flush_once: true
|
flush_once: true
|
||||||
|
|
||||||
when@test: *dev
|
when@test: *dev
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
when@dev: &dev
|
||||||
|
# See full configuration: https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#full-default-bundle-configuration
|
||||||
|
zenstruck_foundry:
|
||||||
|
persistence:
|
||||||
|
# Flush only once per call of `PersistentObjectFactory::create()`
|
||||||
|
flush_once: true
|
||||||
|
|
||||||
|
when@test: *dev
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"copy-from-recipe": {
|
||||||
|
"config/": "%CONFIG_DIR%/",
|
||||||
|
"src/": "%SRC_DIR%/"
|
||||||
|
},
|
||||||
|
"bundles": {
|
||||||
|
"Zenstruck\\Foundry\\ZenstruckFoundryBundle": ["dev", "test"]
|
||||||
|
},
|
||||||
|
"conflict": {
|
||||||
|
"doctrine/persistence": "<2.0",
|
||||||
|
"symfony/framework-bundle": "<6.4"
|
||||||
|
},
|
||||||
|
"aliases": ["foundry"]
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
* You're ready to use zenstruck/foundry. Create your first factory with
|
||||||
|
<info>bin/console make:factory</>.
|
||||||
|
|
||||||
|
* <fg=blue>Read</> the documentation at <comment>https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html</>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Story;
|
||||||
|
|
||||||
|
use Zenstruck\Foundry\Attribute\AsFixture;
|
||||||
|
use Zenstruck\Foundry\Story;
|
||||||
|
|
||||||
|
#[AsFixture(name: 'main')]
|
||||||
|
final class AppStory extends Story
|
||||||
|
{
|
||||||
|
public function build(): void
|
||||||
|
{
|
||||||
|
// SomeFactory::createOne();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user