Passed
Pull Request — master (#10)
by Anatoly
02:48
created

GenerateOpenApiDocumentCommandTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 21
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testExecute() 0 12 1
1
<?php declare(strict_types=1);
2
3
namespace App\Tests\Command;
4
5
/**
6
 * Import classes
7
 */
8
use App\Tests\ContainerAwareTrait;
9
use PHPUnit\Framework\TestCase;
10
use Symfony\Component\Console\Application;
11
use Symfony\Component\Console\Tester\CommandTester;
12
13
/**
14
 * GenerateOpenApiDocumentCommandTest
15
 */
16
class GenerateOpenApiDocumentCommandTest extends TestCase
17
{
18
    use ContainerAwareTrait;
19
20
    /**
21
     * @return void
22
     *
23
     * @runInSeparateProcess
24
     */
25
    public function testExecute() : void
26
    {
27
        $container = $this->getContainer();
28
29
        $application = new Application();
30
        $application->addCommands($container->get('commands'));
31
32
        $command = $application->find('app:openapi:generate-document');
33
        $commandTester = new CommandTester($command);
34
35
        $commandTester->execute([]);
36
        $this->assertSame(0, $commandTester->getStatusCode());
37
    }
38
}
39