PHP Classes

File: web/SSO/vendor/simplesamlphp/xmlseclibs/tests/withcomment-id-uri.phpt

Recommend this page to a friend!
  Classes of william amed   Raptor 2   web/SSO/vendor/simplesamlphp/xmlseclibs/tests/withcomment-id-uri.phpt   Download  
File: web/SSO/vendor/simplesamlphp/xmlseclibs/tests/withcomment-id-uri.phpt
Role: Example script
Content type: text/plain
Description: Example script
Class: Raptor 2
Framework that takes routes from annotations
Author: By
Last change:
Date: 8 years ago
Size: 760 bytes
 

Contents

Class file image Download
--TEST--
WithComments with an ID reference.
--DESCRIPTION--
Checks that comments are removed when using an ID URI in a Reference.
--FILE--
<?php
require(dirname(__FILE__) . '/../xmlseclibs.php');

$doc = new DOMDocument();
$doc->load(dirname(__FILE__) . '/withcomment-id-uri.xml');
$objXMLSecDSig = new XMLSecurityDSig();
$objXMLSecDSig->idKeys = array('xml:id');

$objDSig = $objXMLSecDSig->locateSignature($doc);
if (!
$objDSig) {
    throw new
Exception("Cannot locate Signature Node");
}

$retVal = $objXMLSecDSig->validateReference();
if (!
$retVal) {
    throw new
Exception("Reference Validation Failed");
}

/*
 * Since we are testing reference canonicalization, we don't need to
 * do more than reference validation here.
 */
echo "OK\n";
?>
--EXPECTF--
OK