Skip to content

Commit 7e7747e

Browse files
authored
[zenstruck/foundry] enable auto refresh with lazy objects in 2.7 (#1441)
1 parent 58a3678 commit 7e7747e

File tree

4 files changed

+60
-0
lines changed

4 files changed

+60
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
when@dev: &dev
2+
# See full configuration: https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#full-default-bundle-configuration
3+
zenstruck_foundry:
4+
persistence:
5+
# Flush only once per call of `PersistentObjectFactory::create()`
6+
flush_once: true
7+
8+
when@test: *dev

zenstruck/foundry/2.7/manifest.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"copy-from-recipe": {
3+
"config/": "%CONFIG_DIR%/",
4+
"src/": "%SRC_DIR%/"
5+
},
6+
"bundles": {
7+
"Zenstruck\\Foundry\\ZenstruckFoundryBundle": ["dev", "test"]
8+
},
9+
"conflict": {
10+
"doctrine/persistence": "<2.0",
11+
"symfony/flex": "<1.23.0 || >=2.0.0,<2.8.0",
12+
"symfony/framework-bundle": "<6.4"
13+
},
14+
"aliases": ["foundry"],
15+
"add-lines": [
16+
{
17+
"file": "phpunit.dist.xml",
18+
"content": " <bootstrap class=\"Zenstruck\\Foundry\\PHPUnit\\FoundryExtension\" />",
19+
"position": "after_target",
20+
"target": "<extensions>",
21+
"requires": "phpunit/phpunit:>=10",
22+
"warn_if_missing": false
23+
},
24+
{
25+
"file": "config/packages/zenstruck_foundry.yaml",
26+
"content": " enable_auto_refresh_with_lazy_objects: true",
27+
"position": "after_target",
28+
"target": "zenstruck_foundry:",
29+
"requires": "php:>=8.4",
30+
"warn_if_missing": false
31+
}
32+
]
33+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
* You're ready to use zenstruck/foundry. Create your first factory with
2+
<info>bin/console make:factory</>.
3+
4+
* <fg=blue>Read</> the documentation at <comment>https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html</>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
namespace App\Story;
4+
5+
use Zenstruck\Foundry\Attribute\AsFixture;
6+
use Zenstruck\Foundry\Story;
7+
8+
#[AsFixture(name: 'main')]
9+
final class AppStory extends Story
10+
{
11+
public function build(): void
12+
{
13+
// SomeFactory::createOne();
14+
}
15+
}

0 commit comments

Comments
 (0)