From: Chris Burgess Date: Fri, 10 Aug 2018 10:05:55 +0000 (+1200) Subject: Issue #316: Update tests for whitespace escaping X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=41c32af34848215bc70ff46b30af1abfc52d01ee;p=civicrm-core.git Issue #316: Update tests for whitespace escaping --- diff --git a/tests/phpunit/CRM/Core/BAO/CacheTest.php b/tests/phpunit/CRM/Core/BAO/CacheTest.php index 900b96dc17..af738cbb2b 100644 --- a/tests/phpunit/CRM/Core/BAO/CacheTest.php +++ b/tests/phpunit/CRM/Core/BAO/CacheTest.php @@ -84,11 +84,12 @@ class CRM_Core_BAO_CacheTest extends CiviUnitTestCase { public function getCleanKeyExamples() { $es = []; - $es[] = ['hello_world and other.planets', 'hello_world and other.planets']; // allowed chars + $es[] = ['hello_world and/other.planets', 'hello_world-20and-2fother.planets']; // allowed chars $es[] = ['hello/world+-#@{}', 'hello-2fworld-2b-2d-23-40-7b-7d']; // escaped chars - $es[] = ['123456789 123456789 123456789 123456789 123456789 123456789 123', '123456789 123456789 123456789 123456789 123456789 123456789 123']; // long but allowed - $es[] = ['123456789 123456789 123456789 123456789 123456789 123456789 1234', '-2a008e182a4dcd1a78f405f30119e5f2']; // too long, md5 fallback - $es[] = ['123456789 /23456789 +23456789 -23456789 123456789 123456789', '-1b6baab5961431ed443ab321f5dfa0fb']; // too long, md5 fallback + $es[] = ['123456789 123456789 123456789 123456789 123456789 123', '123456789-20123456789-20123456789-20123456789-20123456789-20123']; // spaces are escaped + $es[] = ['123456789-123456789-123456789-123456789-123456789-123456789-123', '123456789-123456789-123456789-123456789-123456789-123456789-123']; // long but allowed + $es[] = ['123456789-123456789-123456789-123456789-123456789-123456789-1234', '-afe584fe1d38b9a007df7d7ba30558e2']; // too long, md5 fallback + $es[] = ['123456789-/23456789-+23456789--23456789-123456789-123456789', '-afe584fe1d38b9a007df7d7ba30558e2']; // too long, md5 fallback return $es; }