Skip to content

Commit 6b419e4

Browse files
author
Olga Kopylova
committed
MAGETWO-43452: Ogre sprint 38 contribution to mainline
- avoid merging base XSD with itself
1 parent fdbbef1 commit 6b419e4

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ViewConfigFilesTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class ViewConfigFilesTest extends \PHPUnit_Framework_TestCase
1313
*/
1414
public function testViewConfigFile($file)
1515
{
16+
/** @var \Magento\Framework\View\Xsd\Reader $reader */
1617
$reader = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
1718
'Magento\Framework\View\Xsd\Reader'
1819
);

lib/internal/Magento/Framework/View/Xsd/Reader.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ public function __construct(
7474
public function getListXsdFiles($filename)
7575
{
7676
return $this->iteratorFactory->create(
77-
$this->componentDirSearch->collectFiles(ComponentRegistrar::MODULE, 'etc/' . $filename)
77+
array_merge(
78+
$this->componentDirSearch->collectFiles(ComponentRegistrar::MODULE, 'etc/' . $filename),
79+
$this->componentDirSearch->collectFiles(ComponentRegistrar::LIBRARY, '*/etc/' . $filename)
80+
)
7881
);
7982
}
8083

@@ -108,9 +111,13 @@ public function read($scope = null)
108111
public function readXsdFiles($fileList, $baseXsd = null)
109112
{
110113
$baseXsd = new \DOMDocument();
111-
$baseXsd->load($this->urnResolver->getRealPath($this->searchFilesPattern . $this->fileName));
114+
$baseXsdPath = $this->urnResolver->getRealPath($this->searchFilesPattern . $this->fileName);
115+
$baseXsd->load($baseXsdPath);
112116
$configMerge = null;
113117
foreach ($fileList as $key => $content) {
118+
if ($key == $baseXsdPath) {
119+
continue;
120+
}
114121
try {
115122
if (!empty($content)) {
116123
if ($configMerge) {

0 commit comments

Comments
 (0)