Files
Côme Chilliet 8dcea8a500 fix: Harmonize namepsaces in tests
There was a weird inconsistent mix of Test\, Tests\lib, Test\Core,
 Tests\Core and Core\.
Now there is only Test\ for tests/lib/ and Tests\Core for tests/Core.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2026-08-24 08:38:57 +02:00

53 lines
1.4 KiB
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/
namespace Test\Config;
use OCP\Config\IUserConfig;
use OCP\Config\Lexicon\Entry;
use OCP\Config\Lexicon\ILexicon;
use OCP\Config\Lexicon\Preset;
use OCP\Config\Lexicon\Strictness;
use OCP\Config\ValueType;
use OCP\IAppConfig;
class TestLexicon_E implements ILexicon {
public const APPID = 'lexicon_test_e';
#[\Override]
public function getStrictness(): Strictness {
return Strictness::EXCEPTION;
}
#[\Override]
public function getAppConfigs(): array {
return [
new Entry('key1', ValueType::STRING, 'abcde', 'test key', true, IAppConfig::FLAG_SENSITIVE),
new Entry('key2', ValueType::INT, 12345, 'test key', false),
new Entry('key3', ValueType::STRING, fn (Preset $p): string => match ($p) {
Preset::FAMILY => 'family',
Preset::CLUB, Preset::MEDIUM => 'club+medium',
default => 'none',
}, 'test key'),
];
}
#[\Override]
public function getUserConfigs(): array {
return [
new Entry('key1', ValueType::STRING, 'abcde', 'test key', true, IUserConfig::FLAG_SENSITIVE),
new Entry('key2', ValueType::INT, 12345, 'test key', false),
new Entry('key3', ValueType::STRING, fn (Preset $p): string => match ($p) {
Preset::FAMILY => 'family',
Preset::CLUB, Preset::MEDIUM => 'club+medium',
default => 'none',
}, 'test key'),
];
}
}