[ 'class' => MemoryAdapter::class ] ]; $dirparam = []; foreach ($dirs as $dir) { $dirparam[$dir] = 'testfs'; } $service = new FileSystemService([ FileSystemService::OPTION_ADAPTERS => $adapterparam, FileSystemService::OPTION_DIRECTORIES => $dirparam ]); $service->setServiceLocator($this->getServiceLocatorMock([ FileSystemService::SERVICE_ID => $service ])); return $service; } }