Ejemplo n.º 1
0
 /**
  * Test getter/add/remove for attributes property
  */
 public function testGetAddRemoveAttribute()
 {
     // Change value and assert new
     $newAttribute = new Attribute();
     $this->assertEntity($this->group->addAttribute($newAttribute));
     $this->assertInstanceOf('Pim\\Bundle\\CatalogBundle\\Entity\\Attribute', $this->group->getAttributes()->first());
     $this->assertEntity($this->group->removeAttribute($newAttribute));
     $this->assertNotInstanceOf('Pim\\Bundle\\CatalogBundle\\Entity\\Attribute', $this->group->getAttributes()->first());
     $this->assertCount(0, $this->group->getAttributes());
 }
 /**
  * {@inheritDoc}
  */
 public function removeAttribute(\Pim\Bundle\CatalogBundle\Model\AttributeInterface $attribute)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'removeAttribute', array($attribute));
     return parent::removeAttribute($attribute);
 }