createMock(StorageConfig::class); /** @var UserStoragesService $storageService */ $storageService = $this->createMock(UserStoragesService::class); $storage = $this->createMock(Storage::class); $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')); } }