/** * {@inheritdoc} */ public function write(array $items) { $translations = []; foreach ($items as $item) { $translations = array_merge($translations, $this->writeItem($item)); } $this->configManager->flush(); $this->translationHelper->saveTranslations($translations); }
/** * @dataProvider saveTranslationsDataProvider * * @param array $translations * @param string|null $key * @param string|null $value */ public function testSaveTranslations(array $translations, $key = null, $value = null) { if ($translations) { $this->assertTranslationRepositoryCalled($key, $value); $this->assertTranslationServicesCalled(); } else { $this->repository->expects($this->never())->method($this->anything()); $this->translationCache->expects($this->never())->method($this->anything()); } $this->helper->saveTranslations($translations); }