diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2017-12-12 12:00:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-12 12:00:26 +0300 |
commit | 115e7e29cf60c49ddfebece9c25f35f3c5e5dac4 (patch) | |
tree | b64dd23798a3ceae46cb61e3d1fa3d8b2d64b37b | |
parent | d98dea1eb139ae33dfce28f5c61b140518ef4d1d (diff) | |
parent | 1ceeab92295ea473b8ac87d358b9b24b07caa938 (diff) |
Merge pull request #7458 from nextcloud/fix-calendar-manager-unit-tests
Fix unit tests for CalendarManager
-rw-r--r-- | apps/dav/lib/CalDAV/CalendarManager.php | 10 | ||||
-rw-r--r-- | apps/dav/tests/unit/CalDAV/CalendarManagerTest.php | 7 |
2 files changed, 14 insertions, 3 deletions
diff --git a/apps/dav/lib/CalDAV/CalendarManager.php b/apps/dav/lib/CalDAV/CalendarManager.php index a183ecbdf45..59590def5ec 100644 --- a/apps/dav/lib/CalDAV/CalendarManager.php +++ b/apps/dav/lib/CalDAV/CalendarManager.php @@ -24,6 +24,7 @@ namespace OCA\DAV\CalDAV; use OCP\Calendar\IManager; +use OCP\IConfig; use OCP\IL10N; class CalendarManager { @@ -34,15 +35,20 @@ class CalendarManager { /** @var IL10N */ private $l10n; + /** @var IConfig */ + private $config; + /** * CalendarManager constructor. * * @param CalDavBackend $backend * @param IL10N $l10n + * @param IConfig $config */ - public function __construct(CalDavBackend $backend, IL10N $l10n) { + public function __construct(CalDavBackend $backend, IL10N $l10n, IConfig $config) { $this->backend = $backend; $this->l10n = $l10n; + $this->config = $config; } /** @@ -60,7 +66,7 @@ class CalendarManager { */ private function register(IManager $cm, array $calendars) { foreach($calendars as $calendarInfo) { - $calendar = new Calendar($this->backend, $calendarInfo, $this->l10n); + $calendar = new Calendar($this->backend, $calendarInfo, $this->l10n, $this->config); $cm->registerCalendar(new CalendarImpl( $calendar, $calendarInfo, diff --git a/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php b/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php index db8c536da53..1831840610c 100644 --- a/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php +++ b/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php @@ -28,6 +28,7 @@ use OCA\DAV\CalDAV\CalDavBackend; use OCA\DAV\CalDAV\CalendarImpl; use OCA\DAV\CalDAV\CalendarManager; use OCP\Calendar\IManager; +use OCP\IConfig; use OCP\IL10N; class CalendarManagerTest extends \Test\TestCase { @@ -38,6 +39,9 @@ class CalendarManagerTest extends \Test\TestCase { /** @var IL10N | \PHPUnit_Framework_MockObject_MockObject */ private $l10n; + /** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */ + private $config; + /** @var CalendarManager */ private $manager; @@ -45,8 +49,9 @@ class CalendarManagerTest extends \Test\TestCase { parent::setUp(); $this->backend = $this->createMock(CalDavBackend::class); $this->l10n = $this->createMock(IL10N::class); + $this->config = $this->createMock(IConfig::class); $this->manager = new CalendarManager($this->backend, - $this->l10n); + $this->l10n, $this->config); } public function testSetupCalendarProvider() { |