File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
lib/internal/Magento/Framework/View/Test/Unit/Element Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 15
15
use Magento \Framework \Config \View ;
16
16
use Magento \Framework \Escaper ;
17
17
use Magento \Framework \Event \ManagerInterface as EventManagerInterface ;
18
+ use Magento \Framework \Exception \LocalizedException ;
18
19
use Magento \Framework \ObjectManagerInterface ;
19
20
use Magento \Framework \Session \SessionManagerInterface ;
20
21
use Magento \Framework \Session \SidResolverInterface ;
@@ -242,6 +243,19 @@ public function testGetCacheKey()
242
243
$ this ->assertEquals (AbstractBlock::CUSTOM_CACHE_KEY_PREFIX . $ cacheKey , $ this ->block ->getCacheKey ());
243
244
}
244
245
246
+ /**
247
+ * @return void
248
+ * @throws LocalizedException
249
+ */
250
+ public function testGetCacheKeyFail ()
251
+ {
252
+ $ cacheKey = "test&''Key " ;
253
+ $ this ->block ->setData ('cache_key ' , $ cacheKey );
254
+ $ this ->expectException (LocalizedException::class);
255
+ $ this ->expectExceptionMessage ((string )__ ('Please enter cache key with only alphanumeric or hash string. ' ));
256
+ $ this ->block ->getCacheKey ();
257
+ }
258
+
245
259
/**
246
260
* @return void
247
261
*/
You can’t perform that action at this time.
0 commit comments