From 2afa0bbf024819f84e1f219ea3a40f4292d88270 Mon Sep 17 00:00:00 2001 From: Paragon Initiative Enterprises Date: Mon, 5 Feb 2018 09:47:40 -0500 Subject: [PATCH] Add unit tests against string truncation --- tests/Base64UrlSafeTest.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/tests/Base64UrlSafeTest.php b/tests/Base64UrlSafeTest.php index a41bf1e..136ed61 100644 --- a/tests/Base64UrlSafeTest.php +++ b/tests/Base64UrlSafeTest.php @@ -1,11 +1,19 @@ assertTrue(Binary::safeStrlen($enc) > 65536); + $this->assertSame( + $random, + Base64UrlSafe::decode($enc) + ); + $this->assertSame( + \strtr(\base64_encode($random), '+/', '-_'), + $enc + ); } }