Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
magento2-base
dev
tests
static
testsuite
Magento
Test
Integrity
Layout
BlockNamesTest.php
Go to the documentation of this file.
1
<?php
9
namespace
Magento\Test\Integrity\Layout
;
10
11
class
BlockNamesTest
extends
\PHPUnit\Framework\TestCase
12
{
13
public
function
testBlocksHasName
()
14
{
15
$invoker = new \Magento\Framework\App\Utility\AggregateInvoker($this);
16
$invoker(
22
function
($layoutFile) {
23
$dom = new \DOMDocument();
24
$dom->load($layoutFile);
25
$xpath = new \DOMXpath($dom);
26
$count
= $xpath->query(
'//block[not(@name)]'
)->length;
27
28
if
(
$count
) {
29
$this->fail(
'Following file contains '
.
$count
.
' blocks without name. '
.
30
'File Path:'
.
"\n"
. $layoutFile);
31
}
32
},
33
\Magento\Framework\App\Utility\Files::init
()->getLayoutFiles()
34
);
35
}
36
}
Magento\Framework\App\Utility\Files\init
static init()
Definition:
Files.php:147
$count
$count
Definition:
recent.phtml:13
Magento\Test\Integrity\Layout\BlockNamesTest
Definition:
BlockNamesTest.php:11
Magento\Test\Integrity\Layout\BlockNamesTest\testBlocksHasName
testBlocksHasName()
Definition:
BlockNamesTest.php:13
Magento\Test\Integrity\Layout
Definition:
BlockNamesTest.php:9