Skip to content

Conversation

ttskch
Copy link
Contributor

@ttskch ttskch commented Oct 10, 2025

Q A
License MIT
Doc issue/PR zenstruck/foundry#1000

@symfony-recipes-bot symfony-recipes-bot enabled auto-merge (squash) October 10, 2025 08:19
Copy link

github-actions bot commented Oct 10, 2025

Thanks for the PR 😍

How to test these changes in your application

  1. Define the SYMFONY_ENDPOINT environment variable:

    # On Unix-like (BSD, Linux and macOS)
    export SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes/flex/pull-1459/index.json
    # On Windows
    SET SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes/flex/pull-1459/index.json
  2. Install the package(s) related to this recipe:

    composer req symfony/flex
    composer req 'zenstruck/foundry:^2.7'
  3. Don't forget to unset the SYMFONY_ENDPOINT environment variable when done:

    # On Unix-like (BSD, Linux and macOS)
    unset SYMFONY_ENDPOINT
    # On Windows
    SET SYMFONY_ENDPOINT=

Diff between recipe versions

In order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes.
I'm going keep this comment up to date with any updates of the attached patch.

zenstruck/foundry

1.9 vs 1.10
diff --git a/zenstruck/foundry/1.9/config/packages/dev/zenstruck_foundry.yaml b/zenstruck/foundry/1.9/config/packages/dev/zenstruck_foundry.yaml
deleted file mode 100644
index 655840ce..00000000
--- a/zenstruck/foundry/1.9/config/packages/dev/zenstruck_foundry.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-# See full configuration: https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#full-default-bundle-configuration
-zenstruck_foundry:
-    # Whether to auto-refresh proxies by default (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#auto-refresh)
-    auto_refresh_proxies: true
diff --git a/zenstruck/foundry/1.9/config/packages/test/zenstruck_foundry.yaml b/zenstruck/foundry/1.9/config/packages/test/zenstruck_foundry.yaml
deleted file mode 100644
index 3bf6547e..00000000
--- a/zenstruck/foundry/1.9/config/packages/test/zenstruck_foundry.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-# Unless you want different configuration for test/dev environments,
-# add configuration to config/packages/dev/zenstruck_foundry.yml
-# and this will be synced to your test environment.
-imports:
-    - { resource: ../dev/zenstruck_foundry.yaml }
diff --git a/zenstruck/foundry/1.10/config/packages/zenstruck_foundry.yaml b/zenstruck/foundry/1.10/config/packages/zenstruck_foundry.yaml
new file mode 100644
index 00000000..0657d2c3
--- /dev/null
+++ b/zenstruck/foundry/1.10/config/packages/zenstruck_foundry.yaml
@@ -0,0 +1,7 @@
+when@dev: &dev
+    # See full configuration: https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#full-default-bundle-configuration
+    zenstruck_foundry:
+        # Whether to auto-refresh proxies by default (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#auto-refresh)
+        auto_refresh_proxies: true
+
+when@test: *dev
diff --git a/zenstruck/foundry/1.9/manifest.json b/zenstruck/foundry/1.10/manifest.json
index 9fe1ceb1..050fabbe 100644
--- a/zenstruck/foundry/1.9/manifest.json
+++ b/zenstruck/foundry/1.10/manifest.json
@@ -4,5 +4,9 @@
     },
     "bundles": {
         "Zenstruck\\Foundry\\ZenstruckFoundryBundle": ["dev", "test"]
-    }
+    },
+    "conflict": {
+        "symfony/framework-bundle": "<5.3"
+    },
+    "aliases": ["foundry"]
 }
1.10 vs 2.0
diff --git a/zenstruck/foundry/1.10/config/packages/zenstruck_foundry.yaml b/zenstruck/foundry/2.0/config/packages/zenstruck_foundry.yaml
index 0657d2c3..e3ed04b4 100644
--- a/zenstruck/foundry/1.10/config/packages/zenstruck_foundry.yaml
+++ b/zenstruck/foundry/2.0/config/packages/zenstruck_foundry.yaml
@@ -1,7 +1,5 @@
 when@dev: &dev
     # See full configuration: https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#full-default-bundle-configuration
     zenstruck_foundry:
-        # Whether to auto-refresh proxies by default (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#auto-refresh)
-        auto_refresh_proxies: true
 
 when@test: *dev
2.0 vs 2.5
diff --git a/zenstruck/foundry/2.0/config/packages/zenstruck_foundry.yaml b/zenstruck/foundry/2.5/config/packages/zenstruck_foundry.yaml
index e3ed04b4..20592c51 100644
--- a/zenstruck/foundry/2.0/config/packages/zenstruck_foundry.yaml
+++ b/zenstruck/foundry/2.5/config/packages/zenstruck_foundry.yaml
@@ -1,5 +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
diff --git a/zenstruck/foundry/2.0/manifest.json b/zenstruck/foundry/2.5/manifest.json
index 050fabbe..979f8917 100644
--- a/zenstruck/foundry/2.0/manifest.json
+++ b/zenstruck/foundry/2.5/manifest.json
@@ -6,7 +6,19 @@
         "Zenstruck\\Foundry\\ZenstruckFoundryBundle": ["dev", "test"]
     },
     "conflict": {
-        "symfony/framework-bundle": "<5.3"
+        "doctrine/persistence": "<2.0",
+        "symfony/flex": "<1.23.0 || >=2.0.0,<2.8.0",
+        "symfony/framework-bundle": "<6.4"
     },
-    "aliases": ["foundry"]
+    "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
+        }
+    ]
 }
2.5 vs 2.6
diff --git a/zenstruck/foundry/2.5/manifest.json b/zenstruck/foundry/2.6/manifest.json
index 979f8917..44f5d325 100644
--- a/zenstruck/foundry/2.5/manifest.json
+++ b/zenstruck/foundry/2.6/manifest.json
@@ -1,6 +1,7 @@
 {
     "copy-from-recipe": {
-        "config/": "%CONFIG_DIR%/"
+        "config/": "%CONFIG_DIR%/",
+        "src/": "%SRC_DIR%/"
     },
     "bundles": {
         "Zenstruck\\Foundry\\ZenstruckFoundryBundle": ["dev", "test"]
diff --git a/zenstruck/foundry/2.6/src/Story/AppStory.php b/zenstruck/foundry/2.6/src/Story/AppStory.php
new file mode 100644
index 00000000..5cc56577
--- /dev/null
+++ b/zenstruck/foundry/2.6/src/Story/AppStory.php
@@ -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();
+    }
+}
2.6 vs 2.7
diff --git a/zenstruck/foundry/2.6/config/packages/zenstruck_foundry.yaml b/zenstruck/foundry/2.7/config/packages/zenstruck_foundry.yaml
index 20592c51..09c5c77b 100644
--- a/zenstruck/foundry/2.6/config/packages/zenstruck_foundry.yaml
+++ b/zenstruck/foundry/2.7/config/packages/zenstruck_foundry.yaml
@@ -5,4 +5,12 @@ when@dev: &dev
             # Flush only once per call of `PersistentObjectFactory::create()`
             flush_once: true
 
+    # If you use the `make:factory --test` command, you may need to uncomment the following.
+    # See https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#generate
+    #services:
+    #    App\Tests\Factory\:
+    #        resource: '%kernel.project_dir%/tests/Factory/'
+    #        autowire: true
+    #        autoconfigure: true
+
 when@test: *dev
diff --git a/zenstruck/foundry/2.6/manifest.json b/zenstruck/foundry/2.7/manifest.json
index 44f5d325..d96ab7ef 100644
--- a/zenstruck/foundry/2.6/manifest.json
+++ b/zenstruck/foundry/2.7/manifest.json
@@ -20,6 +20,14 @@
             "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
         }
     ]
 }

auto-merge was automatically disabled October 10, 2025 08:51

Head branch was pushed to by a user without write access

@symfony-recipes-bot symfony-recipes-bot enabled auto-merge (squash) October 10, 2025 08:51
@fabpot fabpot disabled auto-merge October 13, 2025 06:52
@fabpot fabpot merged commit 0748c85 into symfony:main Oct 13, 2025
2 checks passed
@ttskch ttskch deleted the foundry/2.7 branch October 13, 2025 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants