File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
lib/internal/Magento/Framework/View/Test/Unit/Element Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -325,4 +325,30 @@ public function getCacheLifetimeDataProvider()
325
325
],
326
326
];
327
327
}
328
+
329
+ /**
330
+ * @return void
331
+ */
332
+ public function testExtractModuleName ()
333
+ {
334
+ $ blockClassNames = $ this ->getPossibleBlockClassNames ();
335
+
336
+ foreach ($ blockClassNames as $ expectedModuleName => $ className ) {
337
+ $ extractedModuleName = $ this ->block ->extractModuleName ($ className );
338
+ $ this ->assertSame ($ expectedModuleName , $ extractedModuleName );
339
+ }
340
+ }
341
+
342
+ /**
343
+ * @return array
344
+ */
345
+ private function getPossibleBlockClassNames ()
346
+ {
347
+ return [
348
+ 'Vendor_Module ' => 'Vendor\Module\Block\Class ' ,
349
+ 'Vendor_ModuleBlock ' => 'Vendor\ModuleBlock\Block\Class ' ,
350
+ 'Vendor_BlockModule ' => 'Vendor\BlockModule\Block\Class ' ,
351
+ 'Vendor_CustomBlockModule ' => 'Vendor\CustomBlockModule\Block\Class ' ,
352
+ ];
353
+ }
328
354
}
You can’t perform that action at this time.
0 commit comments