Skip to content

[TASK] Make getInstanceIdentifier() and getInstancePath() non-static for overridability#709

Open
dkd-kaehm wants to merge 1 commit intoTYPO3:mainfrom
dkd-kaehm:feature/enable-late-static-binding
Open

[TASK] Make getInstanceIdentifier() and getInstancePath() non-static for overridability#709
dkd-kaehm wants to merge 1 commit intoTYPO3:mainfrom
dkd-kaehm:feature/enable-late-static-binding

Conversation

@dkd-kaehm
Copy link

@dkd-kaehm dkd-kaehm commented Mar 15, 2026

Convert protected static methods to protected instance methods and mark as @internal.
This allows subclasses to override these methods for proper test isolation in parallel
execution (Paratest), without making them part of the public API.

Instead of using static:: binding, use $this-> for natural method overriding.
Solves the need for test isolation in single-test-level parallelization while
signaling that these are internal implementation details.

Fixes: #708

@bmack
Copy link
Member

bmack commented Mar 16, 2026

Hey @dkd-kaehm ,

please either add a test or a doc comment, so this change will stay around and not break when touching these lines again.

@dkd-kaehm dkd-kaehm force-pushed the feature/enable-late-static-binding branch from 9f62cb2 to 84a63d2 Compare March 16, 2026 16:55
@dkd-kaehm
Copy link
Author

Hey @dkd-kaehm ,

please either add a test or a doc comment, so this change will stay around and not break when touching these lines again.

both done, please kick the GH Actions.

@dkd-kaehm dkd-kaehm force-pushed the feature/enable-late-static-binding branch from 84a63d2 to d14fd9f Compare March 16, 2026 17:02
@lolli42
Copy link
Member

lolli42 commented Mar 16, 2026

Mhh. First thought: "Making this de-facto API will probably add headaches as soon as we pick up the 'composer based functional tests' works again." Second thought: "Why are these two methods static anyway?"

-> I understand your need to override these methods when you want to parallelize on a single-test level. I personally would try to avoid that, which is why core parallelizes functionals on a test-class level instead. To still solve your request, we could maybe: Make the methods non-static, keep protected and not private, but mark @internal. This would solve the binding issue, still allows you to override, and makes clear: "If you override, you're on your own and it may break if testing-framework decides to continue in a diverging direction". What do you think?

@dkd-kaehm
Copy link
Author

Mhh. First thought: "Making this de-facto API will probably add headaches as soon as we pick up the 'composer based functional tests' works again." Second thought: "Why are these two methods static anyway?"

-> I understand your need to override these methods when you want to parallelize on a single-test level. I personally would try to avoid that, which is why core parallelizes functionals on a test-class level instead. To still solve your request, we could maybe: Make the methods non-static, keep protected and not private, but mark @internal. This would solve the binding issue, still allows you to override, and makes clear: "If you override, you're on your own and it may break if testing-framework decides to continue in a diverging direction". What do you think?

IMHO it is better, but what is with tests then?

@dkd-kaehm dkd-kaehm force-pushed the feature/enable-late-static-binding branch from d14fd9f to be87dc5 Compare March 16, 2026 17:26
@dkd-kaehm dkd-kaehm changed the title [TASK] Enable late static binding in FunctionalTestCase for worker-specific test isolation [TASK] Make getInstanceIdentifier() and getInstancePath() non-static for overridability Mar 16, 2026
@dkd-kaehm dkd-kaehm force-pushed the feature/enable-late-static-binding branch from be87dc5 to bb92a53 Compare March 16, 2026 17:27
@dkd-kaehm
Copy link
Author

@lolli42
switched to non-static.

@lolli42 lolli42 force-pushed the feature/enable-late-static-binding branch from bb92a53 to 587732c Compare March 23, 2026 21:51
Convert protected static methods to protected instance methods and
mark as @internal. This allows subclasses to override these methods
for test isolation in parallel execution (Paratest), without making
them part of the public API.

Fixes: TYPO3#708
@lolli42 lolli42 force-pushed the feature/enable-late-static-binding branch from 587732c to 869483f Compare March 23, 2026 21:55
@lolli42
Copy link
Member

lolli42 commented Mar 23, 2026

Hey Rafael. Sorry for the delay. I had to first fix CI today, and had another look at the change now.
I rebased it and gave it some thoughts.
I'm sorry for discussing so many details on this rather tiny change, but reading it again I'm now actually a bit unsure if people may hurt us by making especially getInstancePath() non-static, this might be considered breaking in seldom cases (and core probably actually stumbles here). I'll try to pull @sbuerk into this to come up with a final conclusion to solve your initial issue, soon. Please be patient, I'm sure we'll find consensus.

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.

Enable late static binding in FunctionalTestCase for worker-specific test isolation

3 participants