Exemplo n.º 1
0
 public function testCreate()
 {
     $attributeValue = $this->dummyData->getAttributeValue();
     $attribute = new Attribute();
     $attribute->setName('Test Attribute');
     $attribute->setDescription('Test attribute description');
     $attribute->setSortOrder(0);
     $attribute->addAttributeValue($attributeValue);
     $this->assertEntityValid($attribute);
     $this->assertSame('Test Attribute', $attribute->getName());
     $this->assertSame('Test attribute description', $attribute->getDescription());
     $this->assertSame(0, $attribute->getSortOrder());
     $this->assertSame($attributeValue, $attribute->getAttributeValues()[0]);
 }
Exemplo n.º 2
0
 private function setAttribute(Attribute $attribute)
 {
     $this->attribute = $attribute;
     $attribute->addAttributeValue($this);
 }