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