mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 09:42:09 -04:00
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:
parent
3d4ac4fb15
commit
126df9c170
1 changed files with 6 additions and 2 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in a new issue