コード例 #1
0
 /**
  * Module generator test
  *
  * @param $module
  * @param $machine_name
  * @param $module_path,
  * @param $description
  * @param $core
  * @param $package
  * @param $composer
  * @param $dependencies
  *
  * @dataProvider commandData
  */
 public function testGenerateModule($module, $machine_name, $module_path, $description, $core, $package, $composer, $dependencies)
 {
     $generator = new ModuleGenerator();
     $generator->setSkeletonDirs(__DIR__ . '/../../templates');
     $generator->generate($module, $machine_name, $module_path, $description, $core, $package, $composer, $dependencies);
     $files = [$machine_name . '.info.yml', $machine_name . '.module'];
     foreach ($files as $file) {
         $this->assertTrue(file_exists($module_path . '/' . $machine_name . '/' . $file), sprintf('%s has been generated', $module_path . '/' . $machine_name . '/' . $file));
     }
     if ($composer) {
         $this->assertTrue(file_exists($module_path . '/' . $machine_name . '/composer.json'), sprintf('%s has been generated', $module_path . '/' . $machine_name . '/composer.json'));
     }
 }
コード例 #2
0
 protected function getGenerator()
 {
     $generator = new ModuleGenerator();
     $generator->setSkeletonDirs(__DIR__ . '/../../templates');
     return $generator;
 }