summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2022-03-18 17:40:36 +0100
committernextcloud-command <nextcloud-command@users.noreply.github.com>2022-03-18 16:52:30 +0000
commit9c07e47c78781a66587313e0c70d5c37cfe81703 (patch)
treed60ee14bb8aa80284bf45d3b42a69d92f5ad8c0d /apps/dav/tests
parentb0fbcccfe66474d79586001ce9509d346919ae74 (diff)
downloadnextcloud-server-9c07e47c78781a66587313e0c70d5c37cfe81703.tar.gz
nextcloud-server-9c07e47c78781a66587313e0c70d5c37cfe81703.zip
Fix link to calendar user docs in groupware settings
Closes #31617 Signed-off-by: Thomas Citharel <tcit@tcit.fr> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'apps/dav/tests')
-rw-r--r--apps/dav/tests/unit/Settings/CalDAVSettingsTest.php23
1 files changed, 18 insertions, 5 deletions
diff --git a/apps/dav/tests/unit/Settings/CalDAVSettingsTest.php b/apps/dav/tests/unit/Settings/CalDAVSettingsTest.php
index aa2216c480d..3384ead652f 100644
--- a/apps/dav/tests/unit/Settings/CalDAVSettingsTest.php
+++ b/apps/dav/tests/unit/Settings/CalDAVSettingsTest.php
@@ -26,27 +26,34 @@
namespace OCA\DAV\Tests\Unit\DAV\Settings;
use OCA\DAV\Settings\CalDAVSettings;
+use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\AppFramework\Services\IInitialState;
+use OCP\IURLGenerator;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class CalDAVSettingsTest extends TestCase {
- /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IConfig|MockObject */
private $config;
- /** @var OCP\AppFramework\Services\IInitialState|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var IInitialState|MockObject */
private $initialState;
+ /** @var IURLGenerator|MockObject */
+ private $urlGenerator;
+
/** @var CalDAVSettings */
- private $settings;
+ private CalDAVSettings $settings;
protected function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);
$this->initialState = $this->createMock(IInitialState::class);
- $this->settings = new CalDAVSettings($this->config, $this->initialState);
+ $this->urlGenerator = $this->createMock(IURLGenerator::class);
+ $this->settings = new CalDAVSettings($this->config, $this->initialState, $this->urlGenerator);
}
public function testGetForm() {
@@ -58,8 +65,14 @@ class CalDAVSettingsTest extends TestCase {
['dav', 'sendEventRemindersPush', 'no'],
)
->will($this->onConsecutiveCalls('yes', 'no', 'yes', 'yes'));
+ $this->urlGenerator
+ ->expects($this->once())
+ ->method('linkToDocs')
+ ->with('user-sync-calendars')
+ ->willReturn('Some docs URL');
$this->initialState->method('provideInitialState')
->withConsecutive(
+ ['userSyncCalendarsDocUrl', 'Some docs URL'],
['sendInvitations', true],
['generateBirthdayCalendar', false],
['sendEventReminders', true],
@@ -67,7 +80,7 @@ class CalDAVSettingsTest extends TestCase {
);
$result = $this->settings->getForm();
- $this->assertInstanceOf('OCP\AppFramework\Http\TemplateResponse', $result);
+ $this->assertInstanceOf(TemplateResponse::class, $result);
}
public function testGetSection() {