perf(tests): Don't encrypt the same value each time

We have a static class, so we can save the results accross the > 100
tests cases in this class.

Signed-off-by: Carl Schwan <carlschwan@kde.org>
This commit is contained in:
Carl Schwan 2026-06-10 11:19:22 +02:00
parent 3d4ac4fb15
commit 126df9c170
No known key found for this signature in database
GPG key ID: 02325448204E452A

View file

@ -142,8 +142,12 @@ class AppConfigIntegrationTest extends TestCase {
$type = $row[2] ?? IAppConfig::VALUE_MIXED;
if (($row[4] ?? false) === true) {
$type |= IAppConfig::VALUE_SENSITIVE;
$value = self::invokePrivate(AppConfig::class, 'ENCRYPTION_PREFIX') . $this->crypto->encrypt($value);
self::$baseStruct[$appId][$key]['encrypted'] = $value;
if (!isset(self::$baseStruct[$appId][$key]['encrypted'])) {
$value = self::invokePrivate(AppConfig::class, 'ENCRYPTION_PREFIX') . $this->crypto->encrypt($value);
self::$baseStruct[$appId][$key]['encrypted'] = $value;
} else {
$value = self::$baseStruct[$appId][$key]['encrypted'];
}
}
$sql->setParameters(