-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
feature: allow to use Factory::create()
and factory service in data providers
#648
Merged
nikophil
merged 1 commit into
zenstruck:2.x
from
nikophil:feature/create-objects-in-data-providers
Oct 24, 2024
Merged
feature: allow to use Factory::create()
and factory service in data providers
#648
nikophil
merged 1 commit into
zenstruck:2.x
from
nikophil:feature/create-objects-in-data-providers
Oct 24, 2024
Conversation
This file contains 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
nikophil
force-pushed
the
feature/create-objects-in-data-providers
branch
from
June 21, 2024 08:09
ce7b4f7
to
28939c2
Compare
nikophil
changed the title
feature/create objects in data providers
feature: allow to create objects in dataProvider thanks to lazy proxy
Jun 21, 2024
nikophil
force-pushed
the
feature/create-objects-in-data-providers
branch
2 times, most recently
from
June 21, 2024 08:29
3a88b8e
to
233d760
Compare
nikophil
commented
Jun 21, 2024
nikophil
force-pushed
the
feature/create-objects-in-data-providers
branch
6 times, most recently
from
June 21, 2024 09:17
4456128
to
3a46f03
Compare
nikophil
force-pushed
the
feature/create-objects-in-data-providers
branch
2 times, most recently
from
August 7, 2024 13:01
736f045
to
366d37e
Compare
nikophil
commented
Aug 7, 2024
nikophil
force-pushed
the
feature/create-objects-in-data-providers
branch
2 times, most recently
from
August 7, 2024 13:48
a5291f8
to
630c311
Compare
nikophil
changed the title
feature: allow to create objects in dataProvider thanks to lazy proxy
feature: allow to use Aug 7, 2024
Factory::create()
and factory service in data providers
nikophil
force-pushed
the
feature/create-objects-in-data-providers
branch
3 times, most recently
from
August 9, 2024 09:25
a1c9816
to
02f172e
Compare
nikophil
commented
Aug 9, 2024
nikophil
force-pushed
the
feature/create-objects-in-data-providers
branch
2 times, most recently
from
August 9, 2024 10:26
d7cc4f0
to
1c0c494
Compare
nikophil
force-pushed
the
feature/create-objects-in-data-providers
branch
2 times, most recently
from
August 18, 2024 14:18
89ece3f
to
c8b541d
Compare
nikophil
force-pushed
the
feature/create-objects-in-data-providers
branch
from
August 18, 2024 17:41
c8b541d
to
24562e6
Compare
nikophil
force-pushed
the
feature/create-objects-in-data-providers
branch
6 times, most recently
from
October 17, 2024 18:13
24cfd90
to
bc0013e
Compare
nikophil
commented
Oct 17, 2024
nikophil
force-pushed
the
feature/create-objects-in-data-providers
branch
from
October 18, 2024 09:43
bc0013e
to
4fd5ce8
Compare
kbond
approved these changes
Oct 20, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really nice! ❤️
nikophil
force-pushed
the
feature/create-objects-in-data-providers
branch
5 times, most recently
from
October 23, 2024 16:57
14ee628
to
c475210
Compare
nikophil
force-pushed
the
feature/create-objects-in-data-providers
branch
from
October 24, 2024 09:08
c475210
to
9572b62
Compare
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.
fixes #532
Since sebastianbergmann/phpunit#5913, PHPUnit's extensions
bootstrap()
methods are called before data provider and since sebastianbergmann/phpunit#5917, data provider related events are dispatched synchronously (before this, they were deferred, which wasn't useful for us).This now opens the door for cool things:
create()
in the data provider.so, after this PR will be merged, all of these will be working:
Since we need to return a proxy object, I decided that trying to call
NotAProxyButStillPersistentFactory::create()
inside a data provider will throw an error, but I'm open to change this.Sadly, the feature will land in PHPUnit 11.4, which will be released in October. So, we have plenty of time to test it :)
Beside of this, the newly merged PR in PHPUnit, will allow to use the "in-memory" behavior in data providers, which was my last blocker for this awesome feature.