/** * @return void */ public function testTouchTranslationForKeyAndCurrentLocale() { $keyId = $this->glossaryFacade->createKey('SomeNonExistentKey6'); $localeTransfer = $this->localeFacade->getCurrentLocale(); $transferTranslation = $this->glossaryFacade->createTranslationForCurrentLocale('SomeNonExistentKey6', 'some value', true); $specificTranslationQuery = $this->glossaryQueryContainer->queryTranslationByIds($keyId, $localeTransfer->getIdLocale()); $touchQuery = $this->touchQueryContainer->queryTouchListByItemType('translation'); $this->assertEquals(1, $specificTranslationQuery->count()); $touchCountBeforeCreation = $touchQuery->count(); $transferTranslation->setValue('setSomeOtherTranslation'); $this->glossaryFacade->saveTranslation($transferTranslation); $this->glossaryFacade->touchTranslationForKeyId($keyId); $touchCountAfterCreation = $touchQuery->count(); $this->assertEquals('setSomeOtherTranslation', $specificTranslationQuery->findOne()->getValue()); $this->assertTrue($touchCountAfterCreation > $touchCountBeforeCreation); }
/** * @return \Generated\Shared\Transfer\LocaleTransfer */ public function getCurrentLocale() { return $this->localeFacade->getCurrentLocale(); }