stringUtils = $objectManager->get(StringUtils::class); $this->translate = $objectManager->get(TranslateInterface::class); $this->translationDataProvider = $objectManager->get(DataProviderInterface::class); } /** * Test translation data. * * @magentoAppArea frontend * @magentoConfigFixture default_store dev/translate_inline/active 1 */ public function testGetData() { $expectedDictionary = ['Proceed to Checkout' => 'Proceed to Checkout - Translated']; $this->stringUtils->saveTranslate('Proceed to Checkout', 'Proceed to Checkout - Translated'); $this->translate->setLocale('en_US')->loadData('frontend', true); $dictionary = $this->translationDataProvider->getData('Magento/luma'); $this->assertEquals($expectedDictionary, $dictionary); } /** * @inheritdoc */ protected function tearDown(): void { try { $this->stringUtils->deleteTranslate('Proceed to Checkout'); } catch (NoSuchEntityException $exception) { // translate already deleted } } }