Skip to content

Commit 587732c

Browse files
dkd-kaehmlolli42
authored andcommitted
[TASK] Make getInstanceIdentifier() and getInstancePath() non-static
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: #708
1 parent 52be708 commit 587732c

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

Classes/Core/Functional/FunctionalTestCase.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ protected function setUp(): void
284284
self::markTestSkipped('Functional tests must be called through phpunit on CLI');
285285
}
286286

287-
$this->identifier = self::getInstanceIdentifier();
288-
$this->instancePath = self::getInstancePath();
287+
$this->identifier = $this->getInstanceIdentifier();
288+
$this->instancePath = $this->getInstancePath();
289289
putenv('TYPO3_PATH_ROOT=' . $this->instancePath);
290290
putenv('TYPO3_PATH_APP=' . $this->instancePath);
291291

@@ -1098,21 +1098,23 @@ protected function withDatabaseSnapshot(?callable $createCallback = null, ?calla
10981098
}
10991099

11001100
/**
1101-
* Uses a 7 char long hash of class name as identifier.
1101+
* Create a 7 char long hash of class name as identifier.
11021102
*
1103+
* @internal
11031104
* @return non-empty-string
11041105
*/
1105-
protected static function getInstanceIdentifier(): string
1106+
protected function getInstanceIdentifier(): string
11061107
{
11071108
return substr(sha1(static::class), 0, 7);
11081109
}
11091110

11101111
/**
1112+
* @internal Extensions functional tests should usually not fiddle with this. This may break anytime.
11111113
* @return non-empty-string
11121114
*/
1113-
protected static function getInstancePath(): string
1115+
protected function getInstancePath(): string
11141116
{
1115-
$identifier = self::getInstanceIdentifier();
1117+
$identifier = $this->getInstanceIdentifier();
11161118
return ORIGINAL_ROOT . 'typo3temp/var/tests/functional-' . $identifier;
11171119
}
11181120
}

0 commit comments

Comments
 (0)