/** * @group response-validation * @test */ public function the_result_correctly_reports_whether_or_not_it_is_valid() { $result = new SAML2_Response_Validation_Result(); $this->assertTrue($result->isValid()); $this->assertCount(0, $result->getErrors()); $result->addError('Oh noooos!'); $this->assertFalse($result->isValid()); $this->assertCount(1, $result->getErrors()); }
public static function createFromValidationResult(SAML2_Response_Validation_Result $result) { $message = sprintf('Cannot process response, preconditions not met: "%s"', implode('", "', $result->getErrors())); return new self($message); }