validateNumAssertions() 공개 메소드

Verifies that the document only contains a single Assertion (encrypted or not).
public validateNumAssertions ( ) : boolean
리턴 boolean TRUE if the document passes.
예제 #1
0
 /**
  * Tests the validateNumAssertions method of the OneLogin_Saml2_Response
  *
  * @covers OneLogin_Saml2_Response::validateNumAssertions
  */
 public function testValidateNumAssertions()
 {
     $xml = file_get_contents(TEST_ROOT . '/data/responses/response1.xml.base64');
     $response = new OneLogin_Saml2_Response($this->_settings, $xml);
     $this->assertTrue($response->validateNumAssertions());
     $xmlMultiAssertion = file_get_contents(TEST_ROOT . '/data/responses/invalids/multiple_assertions.xml.base64');
     $response2 = new OneLogin_Saml2_Response($this->_settings, $xmlMultiAssertion);
     $this->assertFalse($response2->validateNumAssertions());
 }