Skip to content

Commit 1690005

Browse files
committed
test: add tests/php/Unit/Service/Policy/Provider/LegalInformation/LegalInformationPolicyTest.php
Signed-off-by: Vitor Mattos <[email protected]>
1 parent 220e28a commit 1690005

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
6+
* SPDX-License-Identifier: AGPL-3.0-or-later
7+
*/
8+
9+
namespace OCA\Libresign\Tests\Unit\Service\Policy\Provider\LegalInformation;
10+
11+
use OCA\Libresign\Service\Policy\Provider\LegalInformation\LegalInformationPolicy;
12+
use PHPUnit\Framework\TestCase;
13+
14+
final class LegalInformationPolicyTest extends TestCase {
15+
public function testProviderBuildsDefinition(): void {
16+
$provider = new LegalInformationPolicy();
17+
$this->assertSame([LegalInformationPolicy::KEY], $provider->keys());
18+
19+
$definition = $provider->get(LegalInformationPolicy::KEY);
20+
$this->assertSame(LegalInformationPolicy::KEY, $definition->key());
21+
$this->assertSame('', $definition->defaultSystemValue());
22+
}
23+
24+
public function testNormalizesMarkdownAsString(): void {
25+
$provider = new LegalInformationPolicy();
26+
$definition = $provider->get(LegalInformationPolicy::KEY);
27+
28+
$this->assertSame('**Legal** _terms_', $definition->normalizeValue('**Legal** _terms_'));
29+
$this->assertSame('42', $definition->normalizeValue(42));
30+
}
31+
}

0 commit comments

Comments
 (0)