/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
dev/tests/static/testsuite/Magento/Test/Integrity/Layout/BlockNamesTest.php
36 строк
1 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 10:44
22 окт 2025, 10:44
264bea2
Код
Авторство
О чём код?
<?php /** * Test block names exists * * Copyright 2017 Adobe * All Rights Reserved. */ namespace Magento\Test\Integrity\Layout; class BlockNamesTest extends \PHPUnit\Framework\TestCase { public function testBlocksHasName() { $invoker = new \Magento\Framework\App\Utility\AggregateInvoker($this); $invoker( /** * Test validate that blocks without name doesn't exist in layout file * * @param string $layoutFile */ function ($layoutFile) { $dom = new \DOMDocument(); $dom->load($layoutFile); $xpath = new \DOMXpath($dom); $count = $xpath->query('//block[not(@name)]')->length; if ($count) { $this->fail('Following file contains ' . $count . ' blocks without name. ' . 'File Path:' . "\n" . $layoutFile); } }, \Magento\Framework\App\Utility\Files::init()->getLayoutFiles() ); } }