-
-
Notifications
You must be signed in to change notification settings - Fork 498
[zenstruck/foundry] Add PHPUnit extension #1435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
symfony-recipes-bot
merged 1 commit into
symfony:main
from
HypeMC:foundry-phpunit-extension
Jul 8, 2025
Merged
[zenstruck/foundry] Add PHPUnit extension #1435
symfony-recipes-bot
merged 1 commit into
symfony:main
from
HypeMC:foundry-phpunit-extension
Jul 8, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks for the PR 😍 How to test these changes in your application
Diff between recipe versionsIn order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes. zenstruck/foundry1.9 vs 1.10diff --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 655840c..0000000
--- 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 3bf6547..0000000
--- 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 0000000..0657d2c
--- /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 9fe1ceb..050fabb 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.0diff --git a/zenstruck/foundry/1.10/config/packages/zenstruck_foundry.yaml b/zenstruck/foundry/2.0/config/packages/zenstruck_foundry.yaml
index 0657d2c..e3ed04b 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.5diff --git a/zenstruck/foundry/2.0/config/packages/zenstruck_foundry.yaml b/zenstruck/foundry/2.5/config/packages/zenstruck_foundry.yaml
index e3ed04b..20592c5 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 050fabb..979f891 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.6diff --git a/zenstruck/foundry/2.5/manifest.json b/zenstruck/foundry/2.6/manifest.json
index 979f891..44f5d32 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 0000000..5cc5657
--- /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();
+ }
+} |
nikophil
approved these changes
Jul 8, 2025
Spomky
approved these changes
Jul 8, 2025
fabpot
approved these changes
Jul 8, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Registers Foundry's PHPUnit extension via recipe.
@nikophil Any thoughts on this?