コード例 #1
0
 public function testToArray()
 {
     $contents = ['content1', 'content2'];
     $expectedArray = [];
     $index = 0;
     foreach ($this->filePaths as $filePath) {
         $expectedArray[$filePath] = $contents[$index];
         $this->directoryMock->expects($this->at($index))->method('readFile')->with($filePath)->will($this->returnValue($contents[$index++]));
     }
     $this->assertEquals($expectedArray, $this->fileIterator->toArray());
 }
コード例 #2
0
 /**
  * Constructor.
  *
  * @param Filesystem $filesystem
  * @param string[] $paths
  */
 public function __construct(Filesystem $filesystem, array $paths)
 {
     parent::__construct($filesystem->getDirectoryRead(Filesystem::APP_DIR), $paths);
 }
コード例 #3
0
 /**
  * @param ReadFactory $readFactory
  * @param array $paths
  * @param \Magento\Framework\Module\Dir\ReverseResolver $dirResolver
  */
 public function __construct(ReadFactory $readFactory, array $paths, \Magento\Framework\Module\Dir\ReverseResolver $dirResolver)
 {
     parent::__construct($readFactory, $paths);
     $this->_moduleDirResolver = $dirResolver;
 }
コード例 #4
0
ファイル: FileIterator.php プロジェクト: aiesh/magento2
 /**
  * @param \Magento\Framework\Filesystem\Directory\ReadInterface $directory
  * @param array $paths
  * @param \Magento\Framework\Module\Dir\ReverseResolver $dirResolver
  */
 public function __construct(\Magento\Framework\Filesystem\Directory\ReadInterface $directory, array $paths, \Magento\Framework\Module\Dir\ReverseResolver $dirResolver)
 {
     parent::__construct($directory, $paths);
     $this->_moduleDirResolver = $dirResolver;
 }