15 $invalidTemplates = [];
16 foreach ($this->templatesDataProvider() as
$template) {
17 list($area, $themeId, $module, $file, $xml) =
$template;
18 $params = [
'area' => $area,
'themeId' => $themeId,
'module' => $module];
20 $templateFilename = \Magento\TestFramework\Helper\Bootstrap::getObjectmanager()
21 ->get(\
Magento\Framework\View\FileSystem::class)
22 ->getTemplateFileName($file,
$params);
23 $this->assertFileExists($templateFilename);
24 }
catch (\PHPUnit\Framework\ExpectationFailedException $e) {
25 $invalidTemplates[] =
"File \"{$templateFilename}\" does not exist." .
27 "Parameters: {$area}/{$themeId} {$module}::{$file}" .
36 "Invalid templates found:\n\n" . implode(
"\n-----\n", $invalidTemplates)
40 public function templatesDataProvider()
44 $themes = $this->_getDesignThemes();
45 foreach ($themes as
$theme) {
48 \
Magento\Framework\View\Layout\ProcessorInterface::class,
71 $blocks = $layoutXml->xpath(
'//block');
72 foreach ($blocks as
$block) {
82 $layoutTemplates = $layoutXml->xpath(
'//template');
88 $parent = $action[0]->xpath(
"parent::*");
91 $block = $layoutXml->xpath(
92 "//block[@name='{$referenceName}'] | //referenceBlock[@name='{$referenceName}']" 96 $templates[] = [$module, (string)
$template, $parent[0]->asXml()];
99 case 'addInformationRenderer':
100 case 'addMergeSettingsBlockType':
101 $blockType = $action[0]->xpath(
'block');
104 $templates[] = [$module, (string)
$template, $action[0]->asXml()];
126 $class = (string)$xmlNode;
128 $blockModule = substr(
$class, 0, strpos(
$class,
'_Block'));
141 $enabledModules = $this->_getEnabledModules();
143 if (!isset($enabledModules[$blockModule])) {
_getLayoutTemplates($layoutXml)
$_option $_optionId $class
_getBlockModule($xmlNode)
_isTemplateForDisabledModule($blockModule, $template)
_isFileForDisabledModule($file)
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
static getObjectManager()