Example #1
0
 public function testGetsAttributeValuesForEntity()
 {
     $entityId = 400;
     $attribute1 = new TestCustomAttribute(1, 'a1');
     $attribute2 = new TestCustomAttribute(2, 'a2');
     $attribute3 = new TestCustomAttribute(3, 'a3');
     $value1 = new AttributeEntityValue(1, $entityId, 'att1');
     $value3 = new AttributeEntityValue(3, $entityId, 'att3');
     $value4 = new AttributeEntityValue(4, $entityId, 'att2');
     $list = new AttributeList();
     $list->AddDefinition($attribute1);
     $list->AddDefinition($attribute2);
     $list->AddDefinition($attribute3);
     $list->AddValue($value1);
     $list->AddValue($value3);
     $list->AddValue($value4);
     $values = $list->GetAttributes($entityId);
     $this->assertEquals(array(new Attribute($attribute1, 'att1'), new Attribute($attribute2, null), new Attribute($attribute3, 'att3')), $values);
 }