/** * Test getter/setter for translations property */ public function testTranslations() { $this->assertCount(0, $this->family->getTranslations()); // Change value and assert new $newTranslation = new FamilyTranslation(); $this->assertEntity($this->family->addTranslation($newTranslation)); $this->assertCount(1, $this->family->getTranslations()); $this->assertInstanceOf('Pim\\Bundle\\CatalogBundle\\Entity\\FamilyTranslation', $this->family->getTranslations()->first()); $this->family->addTranslation($newTranslation); $this->assertCount(1, $this->family->getTranslations()); $this->assertEntity($this->family->removeTranslation($newTranslation)); $this->assertCount(0, $this->family->getTranslations()); }
/** * {@inheritDoc} */ public function getTranslations() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getTranslations', array()); return parent::getTranslations(); }