From 7d325a92e719b7cc8b1af111d18f325cfcc672c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20K=C3=A4hm?= Date: Sun, 15 Mar 2026 20:26:40 +0000 Subject: [PATCH] [TASK] Late static binding for getInstanceIdentifier() and getInstancePath() This allows overriding the methods if needed. Fixes: #708 --- Classes/Core/Functional/FunctionalTestCase.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Classes/Core/Functional/FunctionalTestCase.php b/Classes/Core/Functional/FunctionalTestCase.php index b6be4565..390fa4ce 100644 --- a/Classes/Core/Functional/FunctionalTestCase.php +++ b/Classes/Core/Functional/FunctionalTestCase.php @@ -284,8 +284,8 @@ protected function setUp(): void self::markTestSkipped('Functional tests must be called through phpunit on CLI'); } - $this->identifier = self::getInstanceIdentifier(); - $this->instancePath = self::getInstancePath(); + $this->identifier = static::getInstanceIdentifier(); + $this->instancePath = static::getInstancePath(); putenv('TYPO3_PATH_ROOT=' . $this->instancePath); putenv('TYPO3_PATH_APP=' . $this->instancePath); @@ -1098,8 +1098,9 @@ protected function withDatabaseSnapshot(?callable $createCallback = null, ?calla } /** - * Uses a 7 char long hash of class name as identifier. + * Create a 7 char long hash of class name as identifier. * + * @internal * @return non-empty-string */ protected static function getInstanceIdentifier(): string @@ -1108,11 +1109,14 @@ protected static function getInstanceIdentifier(): string } /** + * @internal Extensions functional tests should usually not fiddle with this. This may break anytime. + * Checking instance paths within tests is a use case extensions should face seldomly. There + * are usually ways to avoid it. * @return non-empty-string */ protected static function getInstancePath(): string { - $identifier = self::getInstanceIdentifier(); + $identifier = static::getInstanceIdentifier(); return ORIGINAL_ROOT . 'typo3temp/var/tests/functional-' . $identifier; } }