Skip to content

Commit 181be0d

Browse files
committed
Apply pattern matching datasource config files
The Magento\Ui\DataProvider\Config\FileResolver class currently uses the hardcoded pattern '/*/*/etc/data_source/*' to search for data source configuration files. The method argument $filename, which contains the file pattern that should be matched, is not used. Due to this temorarily excludng files by renaming them with a different file type ending is not possible. For example etc/data_source/customer.xml -> etc/data_source/customer.xml.off This patch applies the specified file name pattern to the pattern.
1 parent fd3a80e commit 181be0d

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

app/code/Magento/Ui/DataProvider/Config/FileResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function get($filename, $scope)
4545
{
4646
$iterator = $this->iteratorFactory->create(
4747
$this->directoryRead,
48-
$this->directoryRead->search('/*/*/etc/data_source/*')
48+
$this->directoryRead->search('/*/*/etc/data_source/' . $filename)
4949
);
5050
return $iterator;
5151
}

dev/tests/unit/testsuite/Magento/Ui/DataProvider/Config/FileResolverTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ public function setUp()
3535
$this->fileResolver = new FileResolver($stubFilesystem, $stubFileIteratorFactory);
3636
}
3737

38-
/**
39-
* @test
40-
*/
41-
public function itShouldApplyTheFilenamePattern()
38+
public function testItAppliesTheFilenamePattern()
4239
{
4340
$this->mockDirectoryRead->expects($this->once())
4441
->method('search')

0 commit comments

Comments
 (0)