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

RunTestCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 29
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 7 1
A execute() 0 7 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