validateNumAssertions() public method

Verifies that the document only contains a single Assertion (encrypted or not).
public validateNumAssertions ( ) : boolean
return boolean TRUE if the document passes.
Esempio n. 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());
 }