public function testAttributeAcceptsDefinedValues() { $attr = new FixedAttribute('foo', Attr::REQUIRED, ['a', 'b', 'c']); $attr->setValue('a'); $this->assertSame('a', $attr->getValue()); $attr->setValue('b'); $this->assertSame('b', $attr->getValue()); $attr->setValue('c'); $this->assertSame('c', $attr->getValue()); }
public function testFixedAttributeWithValueObject() { $attr = new FixedAttribute('foo', Attr::REQUIRED, ['a', 'b', 'c']); $value = new AttributeValue('a'); $attr->setValue($value); $this->assertSame('a', $attr->getValue()); }