public function testMarshallingRegexp()
{
$scope = new Scope();
$scope->scope = "^(.*\\.)?example\\.edu\$";
$scope->regexp = TRUE;
$document = DOMDocumentFactory::fromString('<root />');
$scopeElement = $scope->toXML($document->firstChild);
$scopeElements = Utils::xpQuery($scopeElement, '/root/shibmd:Scope');
$this->assertCount(1, $scopeElements);
$scopeElement = $scopeElements[0];
$this->assertEquals('^(.*\\.)?example\\.edu$', $scopeElement->nodeValue);
$this->assertEquals('urn:mace:shibboleth:metadata:1.0', $scopeElement->namespaceURI);
$this->assertEquals('true', $scopeElement->getAttribute('regexp'));
}