示例#1
0
 public function execute(InputInterface $input, OutputInterface $output)
 {
     $config = $this->getGlobalConfig($input->getOption('config'));
     $group = $input->getArgument('group');
     $class = ucfirst($group);
     $path = $this->buildPath(Configuration::supportDir() . 'Group' . DIRECTORY_SEPARATOR, $class);
     $filename = $path . $class . '.php';
     $gen = new GroupGenerator($config, $group);
     $res = $this->save($filename, $gen->produce());
     if (!$res) {
         $output->writeln("<error>Group {$filename} already exists</error>");
         return;
     }
     $output->writeln("<info>Group extension was created in {$filename}</info>");
     $output->writeln('To use this group extension, include it to "extensions" option of global Codeception config.');
 }
示例#2
0
 public function execute(InputInterface $input, OutputInterface $output)
 {
     $config = $this->getGlobalConfig($input->getOption('config'));
     $group = $input->getArgument('group');
     $class = ucfirst($group);
     $path = $this->buildPath($config['paths']['tests'] . '/_groups/', $class);
     $filename = $this->completeSuffix($class, 'Group');
     $filename = $path . $filename;
     $this->introduceAutoloader($config['paths']['tests'] . DIRECTORY_SEPARATOR . $config['settings']['bootstrap'], 'Group', '_groups');
     $gen = new GroupGenerator($config, $group);
     $res = $this->save($filename, $gen->produce());
     if (!$res) {
         $output->writeln("<error>Group {$filename} already exists</error>");
         return;
     }
     $output->writeln("<info>Group extension was created in {$filename}</info>");
     $output->writeln('To use this group extension, include it to "extensions" option of global Codeception config.');
 }