public function testBuild()
 {
     $options = ['parse' => ['files_for_parse' => [1, 2, 3]], 'write' => ['report_filename' => 'some_filename']];
     $parseResult = ['foo', 'bar', 'baz'];
     $configMock = $this->getMock('\\Magento\\Setup\\Module\\Dependency\\Report\\Data\\ConfigInterface');
     $this->dependenciesParserMock->expects($this->once())->method('parse')->with($options['parse'])->will($this->returnValue($parseResult));
     $this->builder->expects($this->once())->method('buildData')->with($parseResult)->will($this->returnValue($configMock));
     $this->reportWriterMock->expects($this->once())->method('write')->with($options['write'], $configMock);
     $this->builder->build($options);
 }
Ejemplo n.º 2
0
 /**
  * Template method. Check passed options step
  *
  * @param array $options
  * @return void
  * @throws \InvalidArgumentException
  */
 protected function checkOptions($options)
 {
     parent::checkOptions($options);
     if (!isset($options['parse']['config_files']) || empty($options['parse']['config_files'])) {
         throw new \InvalidArgumentException('Parse error. Passed option "config_files" is wrong.');
     }
 }
Ejemplo n.º 3
0
 /**
  * Builder constructor
  *
  * @param \Magento\Setup\Module\Dependency\ParserInterface $dependenciesParser
  * @param \Magento\Setup\Module\Dependency\Report\WriterInterface $reportWriter
  * @param \Magento\Setup\Module\Dependency\Circular $circularBuilder
  */
 public function __construct(ParserInterface $dependenciesParser, WriterInterface $reportWriter, Circular $circularBuilder)
 {
     parent::__construct($dependenciesParser, $reportWriter);
     $this->circularBuilder = $circularBuilder;
 }