public function test_get_first_attribute_by_name_returns_null() { $attributeStatement = new AttributeStatement(); $attributeStatement->addAttribute(new Attribute('a')); $attributeStatement->addAttribute(new Attribute('b')); $attributeStatement->addAttribute(new Attribute('c')); $this->assertNull($attributeStatement->getFirstAttributeByName('x')); }
private function validateAttributeStatement(AttributeStatement $statement) { if (false == $statement->getAllAttributes()) { throw new LightSamlValidationException('AttributeStatement MUST contain at least one Attribute or EncryptedAttribute'); } foreach ($statement->getAllAttributes() as $attribute) { $this->validateAttribute($attribute); } }
public function test_attribute_statement_ok() { $attributeStatement = new AttributeStatement(); $attributeStatement->addAttribute(new Attribute('name', 'value')); $validator = new StatementValidator(); $validator->validateStatement($attributeStatement); }