Codeception\Command\GenerateWPUnit::execute PHP Method

execute() public method

public execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    public function execute(InputInterface $input, OutputInterface $output)
    {
        $suite = $input->getArgument('suite');
        $class = $input->getArgument('class');
        $config = $this->getSuiteConfig($suite, $input->getOption('config'));
        $path = $this->buildPath($config['path'], $class);
        $filename = $this->completeSuffix($this->getClassName($class), 'Test');
        $filename = $path . $filename;
        $gen = $this->getGenerator($config, $class);
        $res = $this->save($filename, $gen->produce());
        if (!$res) {
            $output->writeln("<error>Test {$filename} already exists</error>");
            exit;
        }
        $output->writeln("<info>Test was created in {$filename}</info>");
    }