Completed
Pull Request — master (#204)
by
unknown
02:26
created

ParaTestApplication::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2
Metric Value
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php namespace ParaTest\Console;
2
3
use Symfony\Component\Console\Application;
4
use Symfony\Component\Console\Input\InputInterface;
5
use Symfony\Component\Console\Input\InputDefinition;
6
use Symfony\Component\Console\Input\InputOption;
7
use Symfony\Component\Console\Output\OutputInterface;
8
use ParaTest\Console\Commands\ParaTestCommand;
9
use ParaTest\Console\Testers\PHPUnit;
10
11
class ParaTestApplication extends Application
12
{
13
    const NAME = 'ParaTest';
14
    const VERSION = '0.13.3';
15
16
    public function __construct()
17
    {
18
        parent::__construct(static::NAME, static::VERSION);
19
    }
20
21
    /**
22
     * Instantiates the specific Tester and runs it via the ParaTestCommand
23
     *
24
     * @todo for now paratest will only run the phpunit command
25
     */
26
    public function doRun(InputInterface $input, OutputInterface $output)
27
    {
28
        $this->add(new ParaTestCommand(new PHPUnit()));
29
        return parent::doRun($input, $output);
30
    }
31
32
    /**
33
     * The default InputDefinition for the application. Leave it to specific
34
     * Tester objects for specifying further definitions
35
     *
36
     * @return InputDefinition
37
     */
38
    public function getDefinition()
39
    {
40
        return new InputDefinition(array(
41
            new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message.')
42
        ));
43
    }
44
45
    /**
46
     * @param InputInterface $input
47
     * @return string
48
     */
49
    public function getCommandName(InputInterface $input)
50
    {
51
        return 'paratest';
52
    }
53
}
54