aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/AppConfigTest.php24
-rw-r--r--tests/lib/Calendar/ManagerTest.php4
-rw-r--r--tests/lib/Security/Ip/BruteforceAllowListTest.php4
3 files changed, 28 insertions, 4 deletions
diff --git a/tests/lib/AppConfigTest.php b/tests/lib/AppConfigTest.php
index 4c579bc4f09..03405bf96ca 100644
--- a/tests/lib/AppConfigTest.php
+++ b/tests/lib/AppConfigTest.php
@@ -47,6 +47,13 @@ class AppConfigTest extends TestCase {
'deletethis' => ['deletethis', 'deletethis'],
'key' => ['key', 'value']
],
+ 'searchtest' => [
+ 'search_key1' => ['search_key1', 'key1', IAppConfig::VALUE_STRING],
+ 'search_key2' => ['search_key2', 'key2', IAppConfig::VALUE_STRING],
+ 'search_key3' => ['search_key3', 'key3', IAppConfig::VALUE_STRING],
+ 'searchnot_key4' => ['searchnot_key4', 'key4', IAppConfig::VALUE_STRING],
+ 'search_key5_lazy' => ['search_key5_lazy', 'key5', IAppConfig::VALUE_STRING, true],
+ ],
'someapp' => [
'key' => ['key', 'value'],
'otherkey' => ['otherkey', 'othervalue']
@@ -1454,6 +1461,23 @@ class AppConfigTest extends TestCase {
$this->assertConfigValueNotEquals('testapp', $key, $secret);
}
+ public function testSearchKeyNoLazyLoading(): void {
+ $appConfig = $this->generateAppConfig();
+ $appConfig->searchKeys('searchtest', 'search_');
+ $status = $appConfig->statusCache();
+ $this->assertFalse($status['lazyLoaded'], 'searchKeys() loaded lazy config');
+ }
+
+ public function testSearchKeyFast(): void {
+ $appConfig = $this->generateAppConfig();
+ $this->assertEquals(['search_key1', 'search_key2', 'search_key3'], $appConfig->searchKeys('searchtest', 'search_'));
+ }
+
+ public function testSearchKeyLazy(): void {
+ $appConfig = $this->generateAppConfig();
+ $this->assertEquals(['search_key5_lazy'], $appConfig->searchKeys('searchtest', 'search_', true));
+ }
+
protected function loadConfigValueFromDatabase(string $app, string $key): string|false {
$sql = $this->connection->getQueryBuilder();
$sql->select('configvalue')
diff --git a/tests/lib/Calendar/ManagerTest.php b/tests/lib/Calendar/ManagerTest.php
index fec2cfa0efe..eeaca0dfeb6 100644
--- a/tests/lib/Calendar/ManagerTest.php
+++ b/tests/lib/Calendar/ManagerTest.php
@@ -1075,7 +1075,7 @@ class ManagerTest extends TestCase {
$calendarData->add('METHOD', 'REPLY');
// construct logger return
$this->logger->expects(self::once())->method('warning')
- ->with('iMip message event could not be processed because no corresponding event was found in any calendar ' . $principalUri . 'and UID' . $calendarData->VEVENT->UID->getValue());
+ ->with('iMip message event could not be processed because no corresponding event was found in any calendar', ['principalUri' => $principalUri, 'eventUid' => $calendarData->VEVENT->UID->getValue()]);
// Act
$result = $manager->handleIMipReply($principalUri, $sender, $recipient, $calendarData->serialize());
// Assert
@@ -1523,7 +1523,7 @@ class ManagerTest extends TestCase {
$calendarData->add('METHOD', 'CANCEL');
// construct logger return
$this->logger->expects(self::once())->method('warning')
- ->with('iMip message event could not be processed because no corresponding event was found in any calendar ' . $principalUri . 'and UID' . $calendarData->VEVENT->UID->getValue());
+ ->with('iMip message event could not be processed because no corresponding event was found in any calendar', ['principalUri' => $principalUri, 'eventUid' => $calendarData->VEVENT->UID->getValue()]);
// Act
$result = $manager->handleIMipCancel($principalUri, $sender, $replyTo, $recipient, $calendarData->serialize());
// Assert
diff --git a/tests/lib/Security/Ip/BruteforceAllowListTest.php b/tests/lib/Security/Ip/BruteforceAllowListTest.php
index 0cffc128d64..1454b779c1b 100644
--- a/tests/lib/Security/Ip/BruteforceAllowListTest.php
+++ b/tests/lib/Security/Ip/BruteforceAllowListTest.php
@@ -138,8 +138,8 @@ class BruteforceAllowListTest extends TestCase {
array $allowList,
bool $isAllowListed,
): void {
- $this->appConfig->method('getKeys')
- ->with($this->equalTo('bruteForce'))
+ $this->appConfig->method('searchKeys')
+ ->with($this->equalTo('bruteForce'), $this->equalTo('whitelist_'))
->willReturn(array_keys($allowList));
$this->appConfig->method('getValueString')