/** * Test related methods */ public function testGuessUpdates() { $option = new AttributeOption(); $attribute = new Attribute(); $attribute->addOption($option); $guesser = new AttributeOptionUpdateGuesser(); $em = $this->getEntityManagerMock(); $updates = $guesser->guessUpdates($em, $option, UpdateGuesserInterface::ACTION_UPDATE_ENTITY); $this->assertEquals(1, count($updates)); $this->assertEquals($attribute, $updates[0]); }
/** * {@inheritDoc} */ public function addOption(\Pim\Bundle\CatalogBundle\Model\AttributeOptionInterface $option) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'addOption', array($option)); return parent::addOption($option); }