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
…for overridability

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: TYPO3#708
@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.

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