diff --git a/Classes/Core/Functional/FunctionalTestCase.php b/Classes/Core/Functional/FunctionalTestCase.php index b6be4565..8a02e04d 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 = $this->getInstanceIdentifier(); + $this->instancePath = $this->getInstancePath(); putenv('TYPO3_PATH_ROOT=' . $this->instancePath); putenv('TYPO3_PATH_APP=' . $this->instancePath); @@ -1098,21 +1098,25 @@ 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 + protected function getInstanceIdentifier(): string { return substr(sha1(static::class), 0, 7); } /** + * @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 + protected function getInstancePath(): string { - $identifier = self::getInstanceIdentifier(); + $identifier = $this->getInstanceIdentifier(); return ORIGINAL_ROOT . 'typo3temp/var/tests/functional-' . $identifier; } }