commentsManager = $this->createMock(ICommentsManager::class); $this->userManager = $this->createMock(IUserManager::class); $this->userSession = $this->createMock(IUserSession::class); $this->logger = $this->createMock(LoggerInterface::class); $this->collection = new EntityTypeCollection( 'files', $this->commentsManager, $this->userManager, $this->userSession, $this->logger, function ($child) { return !empty($this->childMap[$child]); } ); } public function testChildExistsYes(): void { $this->childMap[17] = true; $this->assertTrue($this->collection->childExists('17')); } public function testChildExistsNo(): void { $this->assertFalse($this->collection->childExists('17')); } public function testGetChild(): void { $this->childMap[17] = true; $ec = $this->collection->getChild('17'); $this->assertInstanceOf(EntityCollectionImplemantation::class, $ec); } public function testGetChildException(): void { $this->expectException(\Sabre\DAV\Exception\NotFound::class); $this->collection->getChild('17'); } public function testGetChildren(): void { $this->expectException(\Sabre\DAV\Exception\MethodNotAllowed::class); $this->collection->getChildren(); } }