summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/tests')
-rw-r--r--apps/dav/tests/unit/Settings/CalDAVSettingsTest.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/apps/dav/tests/unit/Settings/CalDAVSettingsTest.php b/apps/dav/tests/unit/Settings/CalDAVSettingsTest.php
index dd9942677c0..aa2216c480d 100644
--- a/apps/dav/tests/unit/Settings/CalDAVSettingsTest.php
+++ b/apps/dav/tests/unit/Settings/CalDAVSettingsTest.php
@@ -27,6 +27,7 @@ namespace OCA\DAV\Tests\Unit\DAV\Settings;
use OCA\DAV\Settings\CalDAVSettings;
use OCP\IConfig;
+use OCP\AppFramework\Services\IInitialState;
use Test\TestCase;
class CalDAVSettingsTest extends TestCase {
@@ -34,6 +35,9 @@ class CalDAVSettingsTest extends TestCase {
/** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
private $config;
+ /** @var OCP\AppFramework\Services\IInitialState|\PHPUnit\Framework\MockObject\MockObject */
+ private $initialState;
+
/** @var CalDAVSettings */
private $settings;
@@ -41,10 +45,26 @@ class CalDAVSettingsTest extends TestCase {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
- $this->settings = new CalDAVSettings($this->config);
+ $this->initialState = $this->createMock(IInitialState::class);
+ $this->settings = new CalDAVSettings($this->config, $this->initialState);
}
public function testGetForm() {
+ $this->config->method('getAppValue')
+ ->withConsecutive(
+ ['dav', 'sendInvitations', 'yes'],
+ ['dav', 'generateBirthdayCalendar', 'yes'],
+ ['dav', 'sendEventReminders', 'yes'],
+ ['dav', 'sendEventRemindersPush', 'no'],
+ )
+ ->will($this->onConsecutiveCalls('yes', 'no', 'yes', 'yes'));
+ $this->initialState->method('provideInitialState')
+ ->withConsecutive(
+ ['sendInvitations', true],
+ ['generateBirthdayCalendar', false],
+ ['sendEventReminders', true],
+ ['sendEventRemindersPush', true],
+ );
$result = $this->settings->getForm();
$this->assertInstanceOf('OCP\AppFramework\Http\TemplateResponse', $result);