[zenstruck/foundry] enable auto refresh with lazy objects in 2.7 (#1441)

This commit is contained in:
Nicolas PHILIPPE
2025-07-28 09:55:20 -04:00
committed by GitHub
parent 58a36789b5
commit 7e7747e2ad
4 changed files with 60 additions and 0 deletions
@@ -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
+33
View File
@@ -0,0 +1,33 @@
{
"copy-from-recipe": {
"config/": "%CONFIG_DIR%/",
"src/": "%SRC_DIR%/"
},
"bundles": {
"Zenstruck\\Foundry\\ZenstruckFoundryBundle": ["dev", "test"]
},
"conflict": {
"doctrine/persistence": "<2.0",
"symfony/flex": "<1.23.0 || >=2.0.0,<2.8.0",
"symfony/framework-bundle": "<6.4"
},
"aliases": ["foundry"],
"add-lines": [
{
"file": "phpunit.dist.xml",
"content": " <bootstrap class=\"Zenstruck\\Foundry\\PHPUnit\\FoundryExtension\" />",
"position": "after_target",
"target": "<extensions>",
"requires": "phpunit/phpunit:>=10",
"warn_if_missing": false
},
{
"file": "config/packages/zenstruck_foundry.yaml",
"content": " enable_auto_refresh_with_lazy_objects: true",
"position": "after_target",
"target": "zenstruck_foundry:",
"requires": "php:>=8.4",
"warn_if_missing": false
}
]
}
+4
View File
@@ -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();
}
}