ApplicationTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 6
c 2
b 0
f 0
dl 0
loc 31
rs 10
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 PHPUnit\Framework\TestCase;
8
use Symfony\Component\Console\Input\InputArgument;
9
10
/**
11
 * Class ApplicationTest
12
 */
13
class ApplicationTest extends TestCase
14
{
15
    /**
16
     * @var Application
17
     */
18
    private $application;
19
20
    /**
21
     *
22
     */
23
    protected function setUp(): void
24
    {
25
        $this->application = new Application();
26
    }
27
28
    /**
29
     *
30
     */
31
    public function testCommand(): void
32
    {
33
        static::assertInstanceOf(RunCommand::class, $this->application->get('phpcb'));
34
    }
35
36
    /**
37
     *
38
     */
39
    public function testGetDefinitionClearsArguments(): void
40
    {
41
        $this->application->getDefinition()->setArguments([new InputArgument('foo')]);
42
43
        static::assertEquals(0, $this->application->getDefinition()->getArgumentCount());
44
    }
45
}
46