/** * Test related methods */ public function testGuessUpdates() { $category = new Category(); $translation = new CategoryTranslation(); $translation->setLocale('en_US'); $translation->setForeignKey($category); $guesser = new TranslationsUpdateGuesser(array('Pim\\Bundle\\CatalogBundle\\Entity\\Category')); $em = $this->getEntityManagerMock(); $updates = $guesser->guessUpdates($em, $translation, UpdateGuesserInterface::ACTION_UPDATE_ENTITY); $this->assertEquals(1, count($updates)); $this->assertEquals($category, $updates[0]); }
/** * {@inheritDoc} */ public function setLocale($locale) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'setLocale', array($locale)); return parent::setLocale($locale); }