Esempio 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]);
 }
Esempio n. 2
0
 public function getAttribute()
 {
     $attribute = new Attribute();
     $attribute->setName('Test Attribute');
     $attribute->setDescription('Test Attribute Description');
     $attribute->setSortOrder(0);
     return $attribute;
 }