diff --git a/tests/DecryptAndVerifyTest.php b/tests/DecryptAndVerifyTest.php index 39eff26..9866132 100644 --- a/tests/DecryptAndVerifyTest.php +++ b/tests/DecryptAndVerifyTest.php @@ -939,7 +939,7 @@ public function testDecryptVerifySignedOnlyBadSignature() // }}} $results = $this->gpg->decryptAndVerify($clearsignedData); - $this->assertDecryptAndVerifyResultsEquals($expectedResults, $results); + $this->assertDecryptAndVerifyResultsEquals($expectedResults, $results, true); } /** diff --git a/tests/TestCase.php b/tests/TestCase.php index d5b7c8c..6626f89 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -634,7 +634,7 @@ protected function getTempFilename($filename) return __DIR__ . '/' . self::TEMPDIR . '/' . $filename; } - protected function assertDecryptAndVerifyResultsEquals(array $expected, array $actual) + protected function assertDecryptAndVerifyResultsEquals(array $expected, array $actual, $csf = false) { $this->assertEquals( count($expected), @@ -666,6 +666,11 @@ protected function assertDecryptAndVerifyResultsEquals(array $expected, array $a 'Actual result does not include signatures.' ); + if ($csf && (substr($actual['data'], -1) != "\n")) { + // see discussion around GnuPG's handling of trailing + // newlines in CSF messages at https://dev.gnupg.org/T7106 + $actual['data'] = $actual['data']."\n"; + } $this->assertEquals( $expected['data'], $actual['data'],