public function testIsValidTrue() { $response = $this->getMock('Saml\\Ecp\\Response\\ResponseInterface'); $validator1 = $this->getMock('Saml\\Ecp\\Response\\Validator\\ValidatorInterface'); $validator1->expects($this->once())->method('isValid')->with($response)->will($this->returnValue(true)); $validator2 = $this->getMock('Saml\\Ecp\\Response\\Validator\\ValidatorInterface'); $validator2->expects($this->once())->method('isValid')->with($response)->will($this->returnValue(true)); $this->_chain->addValidator($validator1); $this->_chain->addValidator($validator2); $this->assertTrue($this->_chain->isValid($response)); }
/** * {@inheritdoc} * @see \Saml\Ecp\Response\Validator\ValidatorFactoryInterface::createIdpAuthnResponseValidator() */ public function createIdpAuthnResponseValidator(array $options = array()) { $chainValidator = new Chain(); /* $chainValidator->addValidator(new ContentType(array( ContentType::OPT_EXPECTED_CONTENT_TYPE => MimeType::SOAP, ContentType::OPT_PARTIAL => true ))); */ $chainValidator->addValidator(new SoapEnvelope(array(SoapEnvelope::OPT_SOAP_ENVELOPE_XSD => $this->getOption(self::OPT_SOAP_ENVELOPE_XSD)))); $chainValidator->addValidator(new SoapResponse()); $chainValidator->addValidator(new HttpStatus()); $chainValidator->addValidator(new SamlAuthnResponse(array(SamlAuthnResponse::OPT_SP_ASSERTION_CONSUMER_URL => $this->_getSpAssertionConsumerServiceUrl()))); return $chainValidator; }