createMock(StorageConfig::class); /** @var UserStoragesService $storageService */ $storageService = $this->getMockBuilder('\OCA\Files_External\Service\UserStoragesService') ->disableOriginalConstructor() ->getMock(); $storage = $this->getMockBuilder('\OC\Files\Storage\Storage') ->disableOriginalConstructor() ->getMock(); $storage->expects($this->any()) ->method('getId') ->willReturn('dummy'); $mount = new PersonalMount($storageService, $storageConfig, 10, $storage, '/foo'); $mountManager = new Manager($this->createMock(SetupManagerFactory::class)); $mountManager->addMount($mount); $this->assertEquals([$mount], $mountManager->findByStorageId('dummy')); } }