コード例 #1
0
 /**
  * Test getter/setter for group property
  *
  * TODO : Test with null
  */
 public function testGetSetGroup()
 {
     $this->assertNull($this->attribute->getGroup());
     $attributeGroup = new AttributeGroup();
     $this->assertEntity($this->attribute->setGroup($attributeGroup));
     $this->assertInstanceOf('Pim\\Bundle\\CatalogBundle\\Entity\\AttributeGroup', $this->attribute->getGroup());
     $this->assertEquals($attributeGroup, $this->attribute->getGroup());
 }
コード例 #2
0
 /**
  * Add attributes
  *
  * @param AbstractAttribute $attribute
  *
  * @return AttributeGroup
  */
 public function addAttribute(AbstractAttribute $attribute)
 {
     $this->attributes[] = $attribute;
     $attribute->setGroup($this);
     return $this;
 }