summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2021-06-05 12:36:30 +0200
committerGitHub <noreply@github.com>2021-06-05 12:36:30 +0200
commitb211d02e9c0e1c2f5d3eed0916810d8db732237e (patch)
tree4a0c8b3cb1a771aeb2f7597ce5d58ef324bc185b /apps/dav/tests
parent37a216467cd5bb87377cae3018047acaba6c4cea (diff)
parent70edda034201b9d7c3d38bb714dfb35324b2841c (diff)
downloadnextcloud-server-b211d02e9c0e1c2f5d3eed0916810d8db732237e.tar.gz
nextcloud-server-b211d02e9c0e1c2f5d3eed0916810d8db732237e.zip
Merge pull request #27008 from francoisfreitag/no-jq-app-calendar
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);