From 126df9c170e27f89b180e496076669775b7ff953 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Wed, 10 Jun 2026 11:19:22 +0200 Subject: [PATCH] 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 --- tests/lib/AppConfigIntegrationTest.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/lib/AppConfigIntegrationTest.php b/tests/lib/AppConfigIntegrationTest.php index b9b84065d22..3fc5c39fb6e 100644 --- a/tests/lib/AppConfigIntegrationTest.php +++ b/tests/lib/AppConfigIntegrationTest.php @@ -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(