From cedc0accef57f07b4b2d7fb9e3aef87aa9d17c4a Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 8 Oct 2020 01:00:43 +1100 Subject: [PATCH 1/2] This tests that the decrypt fails, but it fails to take into account one of the failure circumstances This fixes that --- tests/Hyperwallet/Tests/Util/HyperwalletEncryptionTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/Hyperwallet/Tests/Util/HyperwalletEncryptionTest.php b/tests/Hyperwallet/Tests/Util/HyperwalletEncryptionTest.php index 4c185537..aa1744b5 100644 --- a/tests/Hyperwallet/Tests/Util/HyperwalletEncryptionTest.php +++ b/tests/Hyperwallet/Tests/Util/HyperwalletEncryptionTest.php @@ -37,7 +37,10 @@ public function testShouldFailDecryptionWhenWrongPrivateKeyIsUsed() { $encryption2->decrypt($encryptedMessage); $this->fail('Exception expected'); } catch (\Exception $e) { - $this->assertEquals('Decryption error', $e->getMessage()); + $this->assertThat($e->getMessage(), $this->logicalOr( + $this->equalTo('Decryption error'), + $this->equalTo('Ciphertext representative out of range') + )); } } From 4bb095f6afb12a8f5ae02bc21ccea6f4f0b148e4 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 8 Oct 2020 01:05:31 +1100 Subject: [PATCH 2/2] Fix test file namespace --- tests/Hyperwallet/Tests/Util/HyperwalletEncryptionTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Hyperwallet/Tests/Util/HyperwalletEncryptionTest.php b/tests/Hyperwallet/Tests/Util/HyperwalletEncryptionTest.php index aa1744b5..d27fc9d6 100644 --- a/tests/Hyperwallet/Tests/Util/HyperwalletEncryptionTest.php +++ b/tests/Hyperwallet/Tests/Util/HyperwalletEncryptionTest.php @@ -1,5 +1,5 @@