Skip to content

Commit 7d325a9

Browse files
dkd-kaehmlolli42
authored andcommitted
[TASK] Late static binding for getInstanceIdentifier() and getInstancePath()
This allows overriding the methods if needed. Fixes: #708
1 parent 52be708 commit 7d325a9

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

Classes/Core/Functional/FunctionalTestCase.php

Lines changed: 8 additions & 4 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 = static::getInstanceIdentifier();
288+
$this->instancePath = static::getInstancePath();
289289
putenv('TYPO3_PATH_ROOT=' . $this->instancePath);
290290
putenv('TYPO3_PATH_APP=' . $this->instancePath);
291291

@@ -1098,8 +1098,9 @@ 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
*/
11051106
protected static function getInstanceIdentifier(): string
@@ -1108,11 +1109,14 @@ protected static function getInstanceIdentifier(): string
11081109
}
11091110

11101111
/**
1112+
* @internal Extensions functional tests should usually not fiddle with this. This may break anytime.
1113+
* Checking instance paths within tests is a use case extensions should face seldomly. There
1114+
* are usually ways to avoid it.
11111115
* @return non-empty-string
11121116
*/
11131117
protected static function getInstancePath(): string
11141118
{
1115-
$identifier = self::getInstanceIdentifier();
1119+
$identifier = static::getInstanceIdentifier();
11161120
return ORIGINAL_ROOT . 'typo3temp/var/tests/functional-' . $identifier;
11171121
}
11181122
}

0 commit comments

Comments
 (0)