-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
tests: automatically create cascade persist permutations #666
Merged
nikophil
merged 3 commits into
zenstruck:2.x
from
nikophil:tests/automatic-test-of-cascade-persist-combination
Dec 14, 2024
Merged
tests: automatically create cascade persist permutations #666
nikophil
merged 3 commits into
zenstruck:2.x
from
nikophil:tests/automatic-test-of-cascade-persist-combination
Dec 14, 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
commented
Jul 3, 2024
tests/Fixture/DoctrineCascadeRelationship/WithEntityRelationShip.php
Outdated
Show resolved
Hide resolved
nikophil
commented
Jul 3, 2024
nikophil
commented
Jul 3, 2024
tests/Fixture/DoctrineCascadeRelationship/WithEntityRelationShip.php
Outdated
Show resolved
Hide resolved
kbond
reviewed
Jul 3, 2024
tests/Fixture/DoctrineCascadeRelationship/UsingRelationShips.php
Outdated
Show resolved
Hide resolved
tests/Fixture/DoctrineCascadeRelationship/WithEntityRelationShip.php
Outdated
Show resolved
Hide resolved
nikophil
force-pushed
the
tests/automatic-test-of-cascade-persist-combination
branch
10 times, most recently
from
December 12, 2024 17:19
38087c3
to
c157428
Compare
nikophil
force-pushed
the
tests/automatic-test-of-cascade-persist-combination
branch
8 times, most recently
from
December 14, 2024 15:53
ed7f3da
to
c7dc0ad
Compare
nikophil
commented
Dec 14, 2024
if (!\getenv('DATABASE_URL')) { | ||
// this test requires the ORM, but trait RequiresORM is analysed after data provider are called | ||
// then we need to return at least one empty array to avoid an error | ||
// in PHPUnit 12, we will be able to use #[RequiresEnvironmentVariable('DATABASE_URL')] to prevent this |
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.
nikophil
commented
Dec 14, 2024
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [ 8.1, 8.2, 8.3, 8.4 ] | ||
symfony: [ 6.4.*, 7.1.*, 7.2.* ] | ||
database: [ mysql, mongo ] | ||
phpunit: [ 9, 11 ] |
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.
since all relationships combinations are ran only with PHPUnit 11, I'd rather having this version to be first class citizen of the CI
nikophil
force-pushed
the
tests/automatic-test-of-cascade-persist-combination
branch
from
December 14, 2024 17:09
c7dc0ad
to
c56a991
Compare
nikophil
force-pushed
the
tests/automatic-test-of-cascade-persist-combination
branch
from
December 14, 2024 18:24
c56a991
to
0703dfd
Compare
kbond
approved these changes
Dec 14, 2024
nikophil
force-pushed
the
tests/automatic-test-of-cascade-persist-combination
branch
from
December 14, 2024 21:11
0703dfd
to
7433984
Compare
nikophil
deleted the
tests/automatic-test-of-cascade-persist-combination
branch
December 14, 2024 21:17
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 #597
This PR introduces a way to automatically create all permutations for "cascade persist" relationships.
By using a combination of the trait
WithEntityRelationShip
, and the attributeUsingRelationShips
, a data provider is automatically created with all possible combinations of the "cascade persist" and "standard" associations.ex:
Here are some thoughts about this work:
UsingRelationShips
. I don't think it is possible to automatically add it, but I've added a check which enforces to add the provider if the attribute is used