Completed
Pull Request — master (#20)
by Pavel
02:51
created

RunTestCommand::execute()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 2
eloc 4
nc 2
nop 2
1
<?php
2
3
namespace App\Console\Commands;
4
5
use Symfony\Component\Console\Command\Command;
6
use Symfony\Component\Console\Input\InputInterface;
7
use Symfony\Component\Console\Output\OutputInterface;
8
9
/**
10
 * RunTestCommand
11
 */
12
class RunTestCommand extends Command
13
{
14
    /**
15
     * Configuration of command
16
     */
17
    protected function configure()
18
    {
19
        $this
20
            ->setName('run:test')
21
            ->setDescription('Command for run tests')
22
        ;
23
    }
24
25
    /**
26
     * Execute method of command
27
     *
28
     * @param InputInterface $input
29
     * @param OutputInterface $output
30
     *
31
     * @return void
32
     */
33
    protected function execute(InputInterface $input, OutputInterface $output)
34
    {
35
        exec('./vendor/bin/codecept run', $result);
36
        if (is_array($result)) {
37
            $output->writeln($result);
38
        }
39
    }
40
}
41