diff options
Diffstat (limited to 'apps/dav/tests/unit/CalDAV')
-rw-r--r-- | apps/dav/tests/unit/CalDAV/CalDavBackendTest.php | 14 | ||||
-rw-r--r-- | apps/dav/tests/unit/CalDAV/CalendarHomeTest.php | 21 | ||||
-rw-r--r-- | apps/dav/tests/unit/CalDAV/CalendarManagerTest.php | 22 | ||||
-rw-r--r-- | apps/dav/tests/unit/CalDAV/CalendarTest.php | 54 | ||||
-rw-r--r-- | apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php | 8 | ||||
-rw-r--r-- | apps/dav/tests/unit/CalDAV/PublicCalendarTest.php | 19 |
6 files changed, 87 insertions, 51 deletions
diff --git a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php index 13066a5fa9b..3a5cf56409c 100644 --- a/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php +++ b/apps/dav/tests/unit/CalDAV/CalDavBackendTest.php @@ -134,6 +134,8 @@ class CalDavBackendTest extends AbstractCalDavBackend { return vsprintf($text, $parameters); }); + $logger = $this->createMock(\Psr\Log\LoggerInterface::class); + $config = $this->createMock(IConfig::class); $this->userManager->expects($this->any()) @@ -147,14 +149,14 @@ class CalDavBackendTest extends AbstractCalDavBackend { $calendarId = $this->createTestCalendar(); $calendars = $this->backend->getCalendarsForUser(self::UNIT_TEST_USER); $this->assertCount(1, $calendars); - $calendar = new Calendar($this->backend, $calendars[0], $l10n, $config); + $calendar = new Calendar($this->backend, $calendars[0], $l10n, $config, $logger); $this->legacyDispatcher->expects($this->at(0)) ->method('dispatch') ->with('\OCA\DAV\CalDAV\CalDavBackend::updateShares'); $this->backend->updateShares($calendar, $add, []); $calendars = $this->backend->getCalendarsForUser(self::UNIT_TEST_USER1); $this->assertCount(1, $calendars); - $calendar = new Calendar($this->backend, $calendars[0], $l10n, $config); + $calendar = new Calendar($this->backend, $calendars[0], $l10n, $config, $logger); $acl = $calendar->getACL(); $this->assertAcl(self::UNIT_TEST_USER, '{DAV:}read', $acl); $this->assertAcl(self::UNIT_TEST_USER, '{DAV:}write', $acl); @@ -500,8 +502,8 @@ EOD; /** @var IL10N|\PHPUnit\Framework\MockObject\MockObject $l10n */ $l10n = $this->createMock(IL10N::class); $config = $this->createMock(IConfig::class); - - $calendar = new Calendar($this->backend, $calendarInfo, $l10n, $config); + $logger = $this->createMock(\Psr\Log\LoggerInterface::class); + $calendar = new Calendar($this->backend, $calendarInfo, $l10n, $config, $logger); $calendar->setPublishStatus(true); $this->assertNotEquals(false, $calendar->getPublishStatus()); @@ -1237,7 +1239,9 @@ EOD; $sharerCalendars = $this->backend->getCalendarsForUser($sharer); $this->assertCount(1, $sharerCalendars); - $sharerCalendar = new Calendar($this->backend, $sharerCalendars[0], $l10n, $config); + + $logger = $this->createMock(\Psr\Log\LoggerInterface::class); + $sharerCalendar = new Calendar($this->backend, $sharerCalendars[0], $l10n, $config, $logger); $this->backend->updateShares($sharerCalendar, [ [ 'href' => 'principal:' . $me, diff --git a/apps/dav/tests/unit/CalDAV/CalendarHomeTest.php b/apps/dav/tests/unit/CalDAV/CalendarHomeTest.php index 451be14bcaf..ee3bc2b0859 100644 --- a/apps/dav/tests/unit/CalDAV/CalendarHomeTest.php +++ b/apps/dav/tests/unit/CalDAV/CalendarHomeTest.php @@ -32,13 +32,15 @@ use OCA\DAV\CalDAV\Integration\ExternalCalendar; use OCA\DAV\CalDAV\Integration\ICalendarProvider; use OCA\DAV\CalDAV\Outbox; use OCA\DAV\CalDAV\Trashbin\TrashbinHome; +use PHPUnit\Framework\MockObject\MockObject; +use Psr\Log\LoggerInterface; use Sabre\CalDAV\Schedule\Inbox; use Sabre\DAV\MkCol; use Test\TestCase; class CalendarHomeTest extends TestCase { - /** @var CalDavBackend | \PHPUnit\Framework\MockObject\MockObject */ + /** @var CalDavBackend | MockObject */ private $backend; /** @var array */ @@ -50,6 +52,9 @@ class CalendarHomeTest extends TestCase { /** @var CalendarHome */ private $calendarHome; + /** @var MockObject|LoggerInterface */ + private $logger; + protected function setUp(): void { parent::setUp(); @@ -58,9 +63,13 @@ class CalendarHomeTest extends TestCase { 'uri' => 'user-principal-123', ]; $this->pluginManager = $this->createMock(PluginManager::class); + $this->logger = $this->createMock(LoggerInterface::class); - $this->calendarHome = new CalendarHome($this->backend, - $this->principalInfo); + $this->calendarHome = new CalendarHome( + $this->backend, + $this->principalInfo, + $this->logger + ); // Replace PluginManager with our mock $reflection = new \ReflectionClass($this->calendarHome); @@ -70,7 +79,7 @@ class CalendarHomeTest extends TestCase { } public function testCreateCalendarValidName() { - /** @var MkCol | \PHPUnit\Framework\MockObject\MockObject $mkCol */ + /** @var MkCol | MockObject $mkCol */ $mkCol = $this->createMock(MkCol::class); $mkCol->method('getResourceType') @@ -90,7 +99,7 @@ class CalendarHomeTest extends TestCase { $this->expectException(\Sabre\DAV\Exception\MethodNotAllowed::class); $this->expectExceptionMessage('The resource you tried to create has a reserved name'); - /** @var MkCol | \PHPUnit\Framework\MockObject\MockObject $mkCol */ + /** @var MkCol | MockObject $mkCol */ $mkCol = $this->createMock(MkCol::class); $this->calendarHome->createExtendedCollection('contact_birthdays', $mkCol); @@ -100,7 +109,7 @@ class CalendarHomeTest extends TestCase { $this->expectException(\Sabre\DAV\Exception\MethodNotAllowed::class); $this->expectExceptionMessage('The resource you tried to create has a reserved name'); - /** @var MkCol | \PHPUnit\Framework\MockObject\MockObject $mkCol */ + /** @var MkCol | MockObject $mkCol */ $mkCol = $this->createMock(MkCol::class); $this->calendarHome->createExtendedCollection('app-generated--example--foo-1', $mkCol); diff --git a/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php b/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php index c9bd526a505..f16a06f953d 100644 --- a/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php +++ b/apps/dav/tests/unit/CalDAV/CalendarManagerTest.php @@ -32,28 +32,38 @@ use OCA\DAV\CalDAV\CalendarManager; use OCP\Calendar\IManager; use OCP\IConfig; use OCP\IL10N; +use PHPUnit\Framework\MockObject\MockObject; +use Psr\Log\LoggerInterface; class CalendarManagerTest extends \Test\TestCase { - /** @var CalDavBackend | \PHPUnit\Framework\MockObject\MockObject */ + /** @var CalDavBackend | MockObject */ private $backend; - /** @var IL10N | \PHPUnit\Framework\MockObject\MockObject */ + /** @var IL10N | MockObject */ private $l10n; - /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */ + /** @var IConfig|MockObject */ private $config; /** @var CalendarManager */ private $manager; + /** @var MockObject|LoggerInterface */ + private $logger; + protected function setUp(): void { 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->config); + $this->logger = $this->createMock(LoggerInterface::class); + $this->manager = new CalendarManager( + $this->backend, + $this->l10n, + $this->config, + $this->logger + ); } public function testSetupCalendarProvider() { @@ -65,7 +75,7 @@ class CalendarManagerTest extends \Test\TestCase { ['id' => 456, 'uri' => 'blablub2'], ]); - /** @var IManager | \PHPUnit\Framework\MockObject\MockObject $calendarManager */ + /** @var IManager | MockObject $calendarManager */ $calendarManager = $this->createMock(Manager::class); $calendarManager->expects($this->at(0)) ->method('registerCalendar') diff --git a/apps/dav/tests/unit/CalDAV/CalendarTest.php b/apps/dav/tests/unit/CalDAV/CalendarTest.php index 4b89e35e81a..95cedb6da6a 100644 --- a/apps/dav/tests/unit/CalDAV/CalendarTest.php +++ b/apps/dav/tests/unit/CalDAV/CalendarTest.php @@ -33,6 +33,8 @@ use OCA\DAV\CalDAV\CalDavBackend; use OCA\DAV\CalDAV\Calendar; use OCP\IConfig; use OCP\IL10N; +use PHPUnit\Framework\MockObject\MockObject; +use Psr\Log\LoggerInterface; use Sabre\DAV\PropPatch; use Sabre\VObject\Reader; use Test\TestCase; @@ -45,11 +47,15 @@ class CalendarTest extends TestCase { /** @var IConfig */ protected $config; + /** @var MockObject|LoggerInterface */ + protected $logger; + protected function setUp(): void { parent::setUp(); $this->l10n = $this->getMockBuilder(IL10N::class) ->disableOriginalConstructor()->getMock(); $this->config = $this->createMock(IConfig::class); + $this->logger = $this->createMock(LoggerInterface::class); $this->l10n ->expects($this->any()) ->method('t') @@ -59,7 +65,7 @@ class CalendarTest extends TestCase { } public function testDelete() { - /** @var \PHPUnit\Framework\MockObject\MockObject | CalDavBackend $backend */ + /** @var MockObject | CalDavBackend $backend */ $backend = $this->getMockBuilder(CalDavBackend::class)->disableOriginalConstructor()->getMock(); $backend->expects($this->once())->method('updateShares'); $backend->expects($this->any())->method('getShares')->willReturn([ @@ -71,7 +77,7 @@ class CalendarTest extends TestCase { 'id' => 666, 'uri' => 'cal', ]; - $c = new Calendar($backend, $calendarInfo, $this->l10n, $this->config); + $c = new Calendar($backend, $calendarInfo, $this->l10n, $this->config, $this->logger); $c->delete(); } @@ -79,7 +85,7 @@ class CalendarTest extends TestCase { public function testDeleteFromGroup() { $this->expectException(\Sabre\DAV\Exception\Forbidden::class); - /** @var \PHPUnit\Framework\MockObject\MockObject | CalDavBackend $backend */ + /** @var MockObject | CalDavBackend $backend */ $backend = $this->getMockBuilder(CalDavBackend::class)->disableOriginalConstructor()->getMock(); $backend->expects($this->never())->method('updateShares'); $backend->expects($this->any())->method('getShares')->willReturn([ @@ -91,12 +97,12 @@ class CalendarTest extends TestCase { 'id' => 666, 'uri' => 'cal', ]; - $c = new Calendar($backend, $calendarInfo, $this->l10n, $this->config); + $c = new Calendar($backend, $calendarInfo, $this->l10n, $this->config, $this->logger); $c->delete(); } public function testDeleteOwn() { - /** @var \PHPUnit\Framework\MockObject\MockObject | CalDavBackend $backend */ + /** @var MockObject | CalDavBackend $backend */ $backend = $this->createMock(CalDavBackend::class); $backend->expects($this->never())->method('updateShares'); $backend->expects($this->never())->method('getShares'); @@ -112,12 +118,12 @@ class CalendarTest extends TestCase { 'id' => 666, 'uri' => 'cal', ]; - $c = new Calendar($backend, $calendarInfo, $this->l10n, $this->config); + $c = new Calendar($backend, $calendarInfo, $this->l10n, $this->config, $this->logger); $c->delete(); } public function testDeleteBirthdayCalendar() { - /** @var \PHPUnit\Framework\MockObject\MockObject | CalDavBackend $backend */ + /** @var MockObject | CalDavBackend $backend */ $backend = $this->createMock(CalDavBackend::class); $backend->expects($this->once())->method('deleteCalendar') ->with(666); @@ -133,7 +139,7 @@ class CalendarTest extends TestCase { 'uri' => 'contact_birthdays', ]; - $c = new Calendar($backend, $calendarInfo, $this->l10n, $this->config); + $c = new Calendar($backend, $calendarInfo, $this->l10n, $this->config, $this->logger); $c->delete(); } @@ -168,7 +174,7 @@ class CalendarTest extends TestCase { * @dataProvider dataPropPatch */ public function testPropPatch($ownerPrincipal, $principalUri, $mutations, $shared) { - /** @var \PHPUnit\Framework\MockObject\MockObject | CalDavBackend $backend */ + /** @var MockObject | CalDavBackend $backend */ $backend = $this->getMockBuilder(CalDavBackend::class)->disableOriginalConstructor()->getMock(); $calendarInfo = [ '{http://owncloud.org/ns}owner-principal' => $ownerPrincipal, @@ -176,7 +182,7 @@ class CalendarTest extends TestCase { 'id' => 666, 'uri' => 'default' ]; - $c = new Calendar($backend, $calendarInfo, $this->l10n, $this->config); + $c = new Calendar($backend, $calendarInfo, $this->l10n, $this->config, $this->logger); $propPatch = new PropPatch($mutations); if (!$shared) { @@ -192,7 +198,7 @@ class CalendarTest extends TestCase { * @dataProvider providesReadOnlyInfo */ public function testAcl($expectsWrite, $readOnlyValue, $hasOwnerSet, $uri = 'default') { - /** @var \PHPUnit\Framework\MockObject\MockObject | CalDavBackend $backend */ + /** @var MockObject | CalDavBackend $backend */ $backend = $this->getMockBuilder(CalDavBackend::class)->disableOriginalConstructor()->getMock(); $backend->expects($this->any())->method('applyShareAcl')->willReturnArgument(1); $calendarInfo = [ @@ -206,7 +212,7 @@ class CalendarTest extends TestCase { if ($hasOwnerSet) { $calendarInfo['{http://owncloud.org/ns}owner-principal'] = 'user1'; } - $c = new Calendar($backend, $calendarInfo, $this->l10n, $this->config); + $c = new Calendar($backend, $calendarInfo, $this->l10n, $this->config, $this->logger); $acl = $c->getACL(); $childAcl = $c->getChildACL(); @@ -299,7 +305,7 @@ class CalendarTest extends TestCase { $calObject1 = ['uri' => 'event-1', 'classification' => CalDavBackend::CLASSIFICATION_CONFIDENTIAL]; $calObject2 = ['uri' => 'event-2', 'classification' => CalDavBackend::CLASSIFICATION_PRIVATE]; - /** @var \PHPUnit\Framework\MockObject\MockObject | CalDavBackend $backend */ + /** @var MockObject | CalDavBackend $backend */ $backend = $this->getMockBuilder(CalDavBackend::class)->disableOriginalConstructor()->getMock(); $backend->expects($this->any())->method('getCalendarObjects')->willReturn([ $calObject0, $calObject1, $calObject2 @@ -322,7 +328,7 @@ class CalendarTest extends TestCase { if ($isShared) { $calendarInfo['{http://owncloud.org/ns}owner-principal'] = 'user1'; } - $c = new Calendar($backend, $calendarInfo, $this->l10n, $this->config); + $c = new Calendar($backend, $calendarInfo, $this->l10n, $this->config, $this->logger); $children = $c->getChildren(); $this->assertEquals($expectedChildren, count($children)); $children = $c->getMultipleChildren(['event-0', 'event-1', 'event-2']); @@ -386,7 +392,7 @@ EOD; $calObject1 = ['uri' => 'event-1', 'classification' => CalDavBackend::CLASSIFICATION_CONFIDENTIAL, 'calendardata' => $calData]; $calObject2 = ['uri' => 'event-2', 'classification' => CalDavBackend::CLASSIFICATION_PRIVATE]; - /** @var \PHPUnit\Framework\MockObject\MockObject | CalDavBackend $backend */ + /** @var MockObject | CalDavBackend $backend */ $backend = $this->getMockBuilder(CalDavBackend::class)->disableOriginalConstructor()->getMock(); $backend->expects($this->any())->method('getCalendarObjects')->willReturn([ $calObject0, $calObject1, $calObject2 @@ -406,7 +412,7 @@ EOD; 'id' => 666, 'uri' => 'cal', ]; - $c = new Calendar($backend, $calendarInfo, $this->l10n, $this->config); + $c = new Calendar($backend, $calendarInfo, $this->l10n, $this->config, $this->logger); $this->assertEquals(count($c->getChildren()), $expectedChildren); @@ -439,7 +445,7 @@ EOD; $l10n->expects($this->never()) ->method('t'); } - $c = new Calendar($backend, $calendarInfo, $l10n, $this->config); + $c = new Calendar($backend, $calendarInfo, $l10n, $this->config, $this->logger); $calData = $c->getChild('event-1')->get(); $event = Reader::read($calData); @@ -554,7 +560,7 @@ EOD; 'classification' => CalDavBackend::CLASSIFICATION_CONFIDENTIAL, 'calendardata' => $confidentialObjectData]; - /** @var \PHPUnit\Framework\MockObject\MockObject | CalDavBackend $backend */ + /** @var MockObject | CalDavBackend $backend */ $backend = $this->createMock(CalDavBackend::class); $backend->expects($this->any()) ->method('getCalendarObjects') @@ -604,13 +610,13 @@ EOD; 'uri' => 'cal', ]; - $ownerCalendar = new Calendar($backend, $calendarInfoOwner, $this->l10n, $this->config); - $rwCalendar = new Calendar($backend, $calendarInfoSharedRW, $this->l10n, $this->config); - $roCalendar = new Calendar($backend, $calendarInfoSharedRO, $this->l10n, $this->config); + $ownerCalendar = new Calendar($backend, $calendarInfoOwner, $this->l10n, $this->config, $this->logger); + $rwCalendar = new Calendar($backend, $calendarInfoSharedRW, $this->l10n, $this->config, $this->logger); + $roCalendar = new Calendar($backend, $calendarInfoSharedRO, $this->l10n, $this->config, $this->logger); - $this->assertEquals(count($ownerCalendar->getChildren()), 2); - $this->assertEquals(count($rwCalendar->getChildren()), 2); - $this->assertEquals(count($roCalendar->getChildren()), 2); + $this->assertCount(2, $ownerCalendar->getChildren()); + $this->assertCount(2, $rwCalendar->getChildren()); + $this->assertCount(2, $roCalendar->getChildren()); // calendar data shall not be altered for the owner $this->assertEquals($ownerCalendar->getChild('event-0')->get(), $publicObjectData); diff --git a/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php b/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php index ba67a7f85a6..f3f53067d0d 100644 --- a/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php +++ b/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php @@ -42,6 +42,7 @@ use OCP\IL10N; use OCP\ILogger; use OCP\IUserManager; use OCP\Security\ISecureRandom; +use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Test\TestCase; @@ -83,6 +84,7 @@ class PublicCalendarRootTest extends TestCase { $this->groupManager = $this->createMock(IGroupManager::class); $this->random = \OC::$server->getSecureRandom(); $this->logger = $this->createMock(ILogger::class); + $this->psrLogger = $this->createMock(LoggerInterface::class); $dispatcher = $this->createMock(IEventDispatcher::class); $legacyDispatcher = $this->createMock(EventDispatcherInterface::class); $config = $this->createMock(IConfig::class); @@ -111,7 +113,7 @@ class PublicCalendarRootTest extends TestCase { $this->config = $this->createMock(IConfig::class); $this->publicCalendarRoot = new PublicCalendarRoot($this->backend, - $this->l10n, $this->config); + $this->l10n, $this->config, $this->psrLogger); } protected function tearDown(): void { @@ -165,11 +167,11 @@ class PublicCalendarRootTest extends TestCase { $this->backend->createCalendar(self::UNIT_TEST_USER, 'Example', []); $calendarInfo = $this->backend->getCalendarsForUser(self::UNIT_TEST_USER)[0]; - $calendar = new PublicCalendar($this->backend, $calendarInfo, $this->l10n, $this->config); + $calendar = new PublicCalendar($this->backend, $calendarInfo, $this->l10n, $this->config, $this->psrLogger); $publicUri = $calendar->setPublishStatus(true); $calendarInfo = $this->backend->getPublicCalendar($publicUri); - $calendar = new PublicCalendar($this->backend, $calendarInfo, $this->l10n, $this->config); + $calendar = new PublicCalendar($this->backend, $calendarInfo, $this->l10n, $this->config, $this->psrLogger); return $calendar; } diff --git a/apps/dav/tests/unit/CalDAV/PublicCalendarTest.php b/apps/dav/tests/unit/CalDAV/PublicCalendarTest.php index 163b0ec45b8..d7a281e9d27 100644 --- a/apps/dav/tests/unit/CalDAV/PublicCalendarTest.php +++ b/apps/dav/tests/unit/CalDAV/PublicCalendarTest.php @@ -28,6 +28,8 @@ namespace OCA\DAV\Tests\unit\CalDAV; use OCA\DAV\CalDAV\CalDavBackend; use OCA\DAV\CalDAV\PublicCalendar; use OCP\IConfig; +use PHPUnit\Framework\MockObject\MockObject; +use Psr\Log\LoggerInterface; use Sabre\VObject\Reader; class PublicCalendarTest extends CalendarTest { @@ -42,7 +44,7 @@ class PublicCalendarTest extends CalendarTest { $calObject1 = ['uri' => 'event-1', 'classification' => CalDavBackend::CLASSIFICATION_CONFIDENTIAL]; $calObject2 = ['uri' => 'event-2', 'classification' => CalDavBackend::CLASSIFICATION_PRIVATE]; - /** @var \PHPUnit\Framework\MockObject\MockObject | CalDavBackend $backend */ + /** @var MockObject | CalDavBackend $backend */ $backend = $this->getMockBuilder(CalDavBackend::class)->disableOriginalConstructor()->getMock(); $backend->expects($this->any())->method('getCalendarObjects')->willReturn([ $calObject0, $calObject1, $calObject2 @@ -62,10 +64,11 @@ class PublicCalendarTest extends CalendarTest { 'id' => 666, 'uri' => 'cal', ]; - /** @var \PHPUnit\Framework\MockObject\MockObject | IConfig $config */ + /** @var MockObject | IConfig $config */ $config = $this->createMock(IConfig::class); - - $c = new PublicCalendar($backend, $calendarInfo, $this->l10n, $config); + /** @var MockObject | LoggerInterface $logger */ + $logger = $this->createMock(LoggerInterface::class); + $c = new PublicCalendar($backend, $calendarInfo, $this->l10n, $config,$logger); $children = $c->getChildren(); $this->assertEquals(2, count($children)); $children = $c->getMultipleChildren(['event-0', 'event-1', 'event-2']); @@ -129,7 +132,7 @@ EOD; $calObject1 = ['uri' => 'event-1', 'classification' => CalDavBackend::CLASSIFICATION_CONFIDENTIAL, 'calendardata' => $calData]; $calObject2 = ['uri' => 'event-2', 'classification' => CalDavBackend::CLASSIFICATION_PRIVATE]; - /** @var \PHPUnit\Framework\MockObject\MockObject | CalDavBackend $backend */ + /** @var MockObject | CalDavBackend $backend */ $backend = $this->getMockBuilder(CalDavBackend::class)->disableOriginalConstructor()->getMock(); $backend->expects($this->any())->method('getCalendarObjects')->willReturn([ $calObject0, $calObject1, $calObject2 @@ -149,9 +152,11 @@ EOD; 'id' => 666, 'uri' => 'cal', ]; - /** @var \PHPUnit\Framework\MockObject\MockObject | IConfig $config */ + /** @var MockObject | IConfig $config */ $config = $this->createMock(IConfig::class); - $c = new PublicCalendar($backend, $calendarInfo, $this->l10n, $config); + /** @var MockObject | LoggerInterface $logger */ + $logger = $this->createMock(LoggerInterface::class); + $c = new PublicCalendar($backend, $calendarInfo, $this->l10n, $config,$logger); $this->assertEquals(count($c->getChildren()), 2); |