Esempio n. 1
0
 /**
  * Template method. Prepare data step
  *
  * @param \Magento\Setup\Module\Dependency\Report\Framework\Data\Config $config
  * @return array
  */
 protected function prepareData($config)
 {
     $data[] = ['Dependencies of framework:', 'Total number'];
     $data[] = ['', $config->getDependenciesCount()];
     $data[] = [];
     if ($config->getDependenciesCount()) {
         $data[] = ['Dependencies for each module:', ''];
         foreach ($config->getModules() as $module) {
             $data[] = [$module->getName(), $module->getDependenciesCount()];
             foreach ($module->getDependencies() as $dependency) {
                 $data[] = [' -- ' . $dependency->getLib(), $dependency->getCount()];
             }
             $data[] = [];
         }
     }
     array_pop($data);
     return $data;
 }
Esempio n. 2
0
 public function testGetDependenciesCount()
 {
     $this->moduleFirst->expects($this->once())->method('getDependenciesCount')->will($this->returnValue(0));
     $this->moduleSecond->expects($this->once())->method('getDependenciesCount')->will($this->returnValue(2));
     $this->assertEquals(2, $this->config->getDependenciesCount());
 }