ApplicationTest::testCommand()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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