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()); }
/** * Constructor. * * @param Filesystem $filesystem * @param string[] $paths */ public function __construct(Filesystem $filesystem, array $paths) { parent::__construct($filesystem->getDirectoryRead(Filesystem::APP_DIR), $paths); }
/** * @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; }
/** * @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; }