-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'github/develop' into public-pulls
- Loading branch information
Showing
5 changed files
with
76 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
dev/tests/unit/testsuite/Magento/Ui/DataProvider/Config/FileResolverTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
namespace Magento\Ui\DataProvider\Config; | ||
|
||
use Magento\Framework\Filesystem; | ||
use Magento\Ui\DataProvider\Config\FileResolver; | ||
use Magento\Framework\Config\FileIteratorFactory; | ||
|
||
class FileResolverTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @var \Magento\Framework\Filesystem\Directory\Read | \PHPUnit_Framework_MockObject_MockObject | ||
*/ | ||
private $mockDirectoryRead; | ||
|
||
/** | ||
* @var FileResolver | ||
*/ | ||
private $fileResolver; | ||
|
||
public function setUp() | ||
{ | ||
$this->mockDirectoryRead = $this->getMockBuilder('Magento\Framework\Filesystem\Directory\Read') | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
$stubFileIteratorFactory = $this->getMockBuilder('Magento\Framework\Config\FileIteratorFactory') | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
$stubFilesystem = $this->getMockBuilder('Magento\Framework\Filesystem') | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
$stubFilesystem->expects($this->any()) | ||
->method('getDirectoryRead') | ||
->willReturn($this->mockDirectoryRead); | ||
$this->fileResolver = new FileResolver($stubFilesystem, $stubFileIteratorFactory); | ||
} | ||
|
||
public function testItAppliesTheFilenamePattern() | ||
{ | ||
$this->mockDirectoryRead->expects($this->once()) | ||
->method('search') | ||
->with($this->matchesRegularExpression('#\*\.xml$#')) | ||
->willReturn([]); | ||
|
||
$this->fileResolver->get('*.xml', ''); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters