Skip to content

Commit

Permalink
Apply pattern matching datasource config files
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Vinai committed Jan 15, 2015
1 parent fd3a80e commit 181be0d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/code/Magento/Ui/DataProvider/Config/FileResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function get($filename, $scope)
{
$iterator = $this->iteratorFactory->create(
$this->directoryRead,
$this->directoryRead->search('/*/*/etc/data_source/*')
$this->directoryRead->search('/*/*/etc/data_source/' . $filename)
);
return $iterator;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ public function setUp()
$this->fileResolver = new FileResolver($stubFilesystem, $stubFileIteratorFactory);
}

/**
* @test
*/
public function itShouldApplyTheFilenamePattern()
public function testItAppliesTheFilenamePattern()
{
$this->mockDirectoryRead->expects($this->once())
->method('search')
Expand Down

0 comments on commit 181be0d

Please sign in to comment.