public function testMarshalling()
{
$subjectConfirmation = new SubjectConfirmation();
$subjectConfirmation->Method = 'SomeMethod';
$subjectConfirmation->NameID = new NameID();
$subjectConfirmation->NameID->value = 'SomeNameIDValue';
$subjectConfirmation->SubjectConfirmationData = new SubjectConfirmationData();
$document = DOMDocumentFactory::fromString('<root />');
$subjectConfirmationElement = $subjectConfirmation->toXML($document->firstChild);
$subjectConfirmationElements = Utils::xpQuery($subjectConfirmationElement, '//saml_assertion:SubjectConfirmation');
$this->assertCount(1, $subjectConfirmationElements);
$subjectConfirmationElement = $subjectConfirmationElements[0];
$this->assertEquals('SomeMethod', $subjectConfirmationElement->getAttribute("Method"));
$this->assertCount(1, Utils::xpQuery($subjectConfirmationElement, "./saml_assertion:NameID"));
$this->assertCount(1, Utils::xpQuery($subjectConfirmationElement, "./saml_assertion:SubjectConfirmationData"));
}