Passed
Push — master ( baff11...71ae2f )
by Michael
04:40
created

ApplicationTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 31
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testCommand() 0 3 1
A testGetDefinitionClearsArguments() 0 5 1
A setUp() 0 3 1
1
<?php
2
3
namespace PHPCodeBrowser\Tests;
4
5
use PHPCodeBrowser\Application;
6
use PHPCodeBrowser\Command\RunCommand;
7
use Symfony\Component\Console\Input\InputArgument;
8
9
/**
10
 * Class ApplicationTest
11
 */
12
class ApplicationTest extends \PHPUnit\Framework\TestCase
13
{
14
    /**
15
     * @var Application
16
     */
17
    private $application;
18
19
    /**
20
     *
21
     */
22
    protected function setUp(): void
23
    {
24
        $this->application = new Application();
25
    }
26
27
    /**
28
     *
29
     */
30
    public function testCommand(): void
31
    {
32
        $this->assertInstanceOf(RunCommand::class, $this->application->get('phpcb'));
33
    }
34
35
    /**
36
     *
37
     */
38
    public function testGetDefinitionClearsArguments(): void
39
    {
40
        $this->application->getDefinition()->setArguments([new InputArgument('foo')]);
41
42
        $this->assertEquals(0, $this->application->getDefinition()->getArgumentCount());
43
    }
44
}
45