/** * Test getter/setter for translations property */ public function testTranslations() { $this->assertCount(0, $this->attribute->getTranslations()); // Change value and assert new $newTranslation = new AttributeTranslation(); $this->assertEntity($this->attribute->addTranslation($newTranslation)); $this->assertCount(1, $this->attribute->getTranslations()); $this->assertInstanceOf('Pim\\Bundle\\CatalogBundle\\Entity\\AttributeTranslation', $this->attribute->getTranslations()->first()); $this->attribute->addTranslation($newTranslation); $this->assertCount(1, $this->attribute->getTranslations()); $this->assertEntity($this->attribute->removeTranslation($newTranslation)); $this->assertCount(0, $this->attribute->getTranslations()); }