/**
* Test that signatures no longer validate if the value has been tampered with.
*/
public function testValidateWithValueTampering()
{
// Test modification of SignatureValue.
$signedMockElementCopy = Utils::copyElement($this->signedMockElement);
$signedMockElementCopy->ownerDocument->appendChild($signedMockElementCopy);
$digestValueElements = Utils::xpQuery($signedMockElementCopy, '/root/ds:Signature/ds:SignatureValue');
$this->assertCount(1, $digestValueElements);
$digestValueElements[0]->firstChild->data = 'invalid';
$tmp = new SignedElementHelperMock($signedMockElementCopy);
$this->setExpectedException('Exception', 'Unable to validate Signature');
$tmp->validate(CertificatesMock::getPublicKey());
}