Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions Classes/Core/Functional/FunctionalTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
}
}