Skip to content

Fix circular dependency detection in FixtureDependencySorter#28

Open
jdreesen wants to merge 3 commits intomainfrom
bugfix/dependency-sorter
Open

Fix circular dependency detection in FixtureDependencySorter#28
jdreesen wants to merge 3 commits intomainfrom
bugfix/dependency-sorter

Conversation

@jdreesen
Copy link
Copy Markdown
Member

If a fixture had no dependencies, it was not removed from the $checking property.

Also, the circular dependency tracking is improved by using a map instead of a list.

@lukadschaak
Copy link
Copy Markdown
Collaborator

can you a add test case to FixtureDependencySorterTest?

@jdreesen
Copy link
Copy Markdown
Member Author

Okay, it seems like this only happens if you do crazy stuff like adding two fixtures of the same class, which is not really supported by this bundle anyway.


What I was trying to do when I stumbled upon this was to create “configurable” fixtures. They were wrapped in a decorator that contained the actual fixture class along with its configuration. This decorator was then passed instead of the fixture, so I had many objects of this class. I'm not entirely sure if this is a good idea, though 😉

So if you use this bundle as intended, this shouldn't be an issue.

@lukadschaak lukadschaak force-pushed the bugfix/dependency-sorter branch 2 times, most recently from 92976e4 to 9205884 Compare May 11, 2025 19:19
jdreesen added 3 commits May 12, 2025 10:21
If a fixture had no dependencies, it was not removed from the “checking” property.
This commit introduces a test to verify the sorting behavior when multiple fixtures of the same class are provided. It ensures that the sorter maintains the correct order and handles such cases appropriately.
@jdreesen jdreesen force-pushed the bugfix/dependency-sorter branch from 9205884 to 7331bdd Compare May 12, 2025 08:21
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.

2 participants