Skip to content

Commit a113b2e

Browse files
chore: test if value was correctly saved
Signed-off-by: Vitor Mattos <[email protected]>
1 parent a4f89c4 commit a113b2e

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

tests/php/Unit/Service/ReminderServiceTest.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
declare(strict_types=1);
99

10+
use OCA\Libresign\AppInfo\Application;
1011
use OCA\Libresign\Db\SignRequestMapper;
1112
use OCA\Libresign\Service\IdentifyMethodService;
1213
use OCA\Libresign\Service\ReminderService;
@@ -28,7 +29,7 @@ final class ReminderServiceTest extends \OCA\Libresign\Tests\Unit\TestCase {
2829

2930
public function setUp(): void {
3031
$this->jobList = $this->createMock(IJobList::class);
31-
$this->appConfig = Server::get(IAppConfig::class);
32+
$this->appConfig = $this->getMockAppConfig();
3233
$this->dateTimeZone = Server::get(IDateTimeZone::class);
3334
$this->time = Server::get(ITimeFactory::class);
3435
$this->signRequestMapper = $this->createMock(SignRequestMapper::class);
@@ -209,6 +210,20 @@ public function testSave(
209210
$service = $this->getService();
210211
$actual = $service->save($daysBefore, $daysBetween, $max, $sendTimer);
211212
$this->assertEquals($expected, $actual);
213+
214+
$keys = [
215+
'days_before',
216+
'days_between',
217+
'max',
218+
];
219+
220+
foreach ($keys as $key) {
221+
$actualConfig = $this->appConfig->getValueInt(Application::APP_ID, 'reminder_' . $key, $actual[$key]);
222+
$this->assertEquals($actual[$key], $actualConfig);
223+
}
224+
225+
$actualConfig = $this->appConfig->getValueString(Application::APP_ID, 'reminder_send_timer', $actual['send_timer']);
226+
$this->assertEquals($actual['send_timer'], $actualConfig);
212227
}
213228

214229
public static function providerSave(): array {

0 commit comments

Comments
 (0)