77
88declare (strict_types=1 );
99
10+ use OCA \Libresign \AppInfo \Application ;
1011use OCA \Libresign \Db \SignRequestMapper ;
1112use OCA \Libresign \Service \IdentifyMethodService ;
1213use 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