/**
  * Tests the protected method _generateUniqueID of the Maestrano_Saml_Request
  *
  * @covers Maestrano_Saml_Request::_generateUniqueID
  */
 public function testGenerateUniqueID()
 {
     if (class_exists('ReflectionClass')) {
         $reflectionClass = new ReflectionClass("Maestrano_Saml_Request");
         $method = $reflectionClass->getMethod('_generateUniqueID');
         if (method_exists($method, 'setAccessible')) {
             $method->setAccessible(true);
             $metadata = new Maestrano_Saml_Request(array(), SamlTestHelper::getXmlSecSamlTestSettings());
             $id = $method->invoke($metadata);
             $id2 = $method->invoke($metadata);
             $this->assertNotEmpty($id);
             $this->assertNotEmpty($id2);
             $this->assertNotEquals($id, $id2);
             $this->assertContains('Maestrano', $id);
         }
     }
 }
 public function testDoesNotAllowSignatureWrappingAttack()
 {
     $response = SamlTestHelper::buildSamlResponse('response4.xml.base64', $this->settings);
     $this->assertEquals('*****@*****.**', $response->getNameId());
 }
Beispiel #3
0
 public function testValidateAssertionValid()
 {
     $response = SamlTestHelper::buildSamlResponse('valid_response.xml.base64', $this->settings);
     $xmlSec = new Maestrano_Saml_XmlSec($this->settings, $response);
     $this->assertTrue($xmlSec->isValid());
 }